r23017 by craig - C++11 updates and cleanups
scribus-commit
scribus-commit at lists.scribus.net
Mon Jun 10 15:36:31 UTC 2019
Author: craig
Date: Mon Jun 10 15:36:31 2019
New Revision: 23017
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23017
Log:
C++11 updates and cleanups
Modified:
trunk/Scribus/scribus/CMakeLists.txt
trunk/Scribus/scribus/actionmanager.h
trunk/Scribus/scribus/annotation.h
trunk/Scribus/scribus/appmodehelper.cpp
trunk/Scribus/scribus/appmodehelper.h
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/canvas.h
trunk/Scribus/scribus/canvasgesture.h
trunk/Scribus/scribus/canvasgesture_cellselect.h
trunk/Scribus/scribus/canvasgesture_columnresize.h
trunk/Scribus/scribus/canvasgesture_linemove.h
trunk/Scribus/scribus/canvasgesture_pan.h
trunk/Scribus/scribus/canvasgesture_rectselect.cpp
trunk/Scribus/scribus/canvasgesture_rectselect.h
trunk/Scribus/scribus/canvasgesture_resize.h
trunk/Scribus/scribus/canvasgesture_rowresize.h
trunk/Scribus/scribus/canvasgesture_rulermove.h
trunk/Scribus/scribus/canvasgesture_table.cpp
trunk/Scribus/scribus/canvasgesture_table.h
trunk/Scribus/scribus/canvasgesture_tableresize.h
trunk/Scribus/scribus/canvasmode_copyproperties.h
trunk/Scribus/scribus/canvasmode_create.h
trunk/Scribus/scribus/canvasmode_drawbezier.h
trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
trunk/Scribus/scribus/canvasmode_drawfreehand.h
trunk/Scribus/scribus/canvasmode_edit.h
trunk/Scribus/scribus/canvasmode_editarc.h
trunk/Scribus/scribus/canvasmode_editgradient.h
trunk/Scribus/scribus/canvasmode_editmeshgradient.h
trunk/Scribus/scribus/canvasmode_editmeshpatch.h
trunk/Scribus/scribus/canvasmode_editpolygon.h
trunk/Scribus/scribus/canvasmode_editspiral.h
trunk/Scribus/scribus/canvasmode_editweldpoint.h
trunk/Scribus/scribus/canvasmode_eyedropper.h
trunk/Scribus/scribus/canvasmode_framelinks.h
trunk/Scribus/scribus/canvasmode_imageimport.h
trunk/Scribus/scribus/canvasmode_magnifier.h
trunk/Scribus/scribus/canvasmode_measurements.h
trunk/Scribus/scribus/canvasmode_nodeedit.h
trunk/Scribus/scribus/canvasmode_normal.h
trunk/Scribus/scribus/canvasmode_panning.h
trunk/Scribus/scribus/canvasmode_rotate.h
trunk/Scribus/scribus/cellarea.cpp
trunk/Scribus/scribus/cellarea.h
trunk/Scribus/scribus/chartablemodel.cpp
trunk/Scribus/scribus/chartablemodel.h
trunk/Scribus/scribus/chartableview.cpp
trunk/Scribus/scribus/chartableview.h
trunk/Scribus/scribus/cmserrorhandling.h
trunk/Scribus/scribus/collapsedtablepainter.h
trunk/Scribus/scribus/collect4output.h
trunk/Scribus/scribus/colormgmt/scciedata.h
trunk/Scribus/scribus/colormgmt/sccieilluminants.h
trunk/Scribus/scribus/colormgmt/sccieobservers.h
trunk/Scribus/scribus/colormgmt/sccolormgmtelem.h
trunk/Scribus/scribus/colormgmt/sccolorspace.h
trunk/Scribus/scribus/colorsetmanager.cpp
trunk/Scribus/scribus/desaxe/actions.h
trunk/Scribus/scribus/exif.h
trunk/Scribus/scribus/fileloader.h
trunk/Scribus/scribus/filewatcher.cpp
trunk/Scribus/scribus/filewatcher.h
trunk/Scribus/scribus/fonts/scface.h
trunk/Scribus/scribus/fpoint.cpp
trunk/Scribus/scribus/fpoint.h
trunk/Scribus/scribus/fpointarray.h
trunk/Scribus/scribus/hyphenator.h
trunk/Scribus/scribus/loadsaveplugin.h
trunk/Scribus/scribus/margins.h
trunk/Scribus/scribus/menumanager.cpp
trunk/Scribus/scribus/menumanager.h
trunk/Scribus/scribus/pageitem.h
trunk/Scribus/scribus/scfonts.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribuscore.cpp
trunk/Scribus/scribus/scribuscore.h
trunk/Scribus/scribus/scribusdoc.h
trunk/Scribus/scribus/ui/scmenu.cpp
trunk/Scribus/scribus/ui/scmenu.h
trunk/Scribus/scribus/ui/scmessagebox.h
trunk/Scribus/scribus/ui/scmwmenumanager.h
trunk/Scribus/scribus/ui/scrpalettebase.h
trunk/Scribus/scribus/ui/scrspinbox.cpp
trunk/Scribus/scribus/ui/scrspinbox.h
trunk/Scribus/scribus/ui/sctextbrowser.h
trunk/Scribus/scribus/undomanager.h
trunk/Scribus/scribus/undoobject.h
trunk/Scribus/scribus/undostate.cpp
trunk/Scribus/scribus/undostate.h
trunk/Scribus/scribus/undotransaction.h
trunk/Scribus/scribus/updatemanager.h
trunk/Scribus/scribus/util_ghostscript.h
Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Mon Jun 10 15:36:31 2019
@@ -5,18 +5,15 @@
# a custom target that is always built
if (NOT CMAKE_VERSION VERSION_LESS "3.2.0")
- add_custom_target(svnheader ALL COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_MODULE_PATH}/getsvn.cmake BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h)
-
+ add_custom_target(svnheader ALL COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_MODULE_PATH}/getsvn.cmake BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h)
else ()
- add_custom_target(svnheader ALL DEPENDS svn_header ) # svn_header is nothing more than a unique string
-
- # creates svnheader.h using cmake script
- add_custom_command(OUTPUT svn_header ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
+ add_custom_target(svnheader ALL DEPENDS svn_header ) # svn_header is nothing more than a unique string
+ # creates svnheader.h using cmake script
+ add_custom_command(OUTPUT svn_header ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_MODULE_PATH}/getsvn.cmake)
-
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
- PROPERTIES GENERATED TRUE
- HEADER_FILE_ONLY TRUE)
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
+ PROPERTIES GENERATED TRUE
+ HEADER_FILE_ONLY TRUE)
endif ()
endif ()
Modified: trunk/Scribus/scribus/actionmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/actionmanager.h
==============================================================================
--- trunk/Scribus/scribus/actionmanager.h (original)
+++ trunk/Scribus/scribus/actionmanager.h Mon Jun 10 15:36:31 2019
@@ -54,7 +54,7 @@
friend class StoryEditor;
public:
ActionManager ( QObject * parent );
- ~ActionManager();
+ ~ActionManager() override;
virtual void changeEvent(QEvent *e);
Modified: trunk/Scribus/scribus/annotation.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/annotation.h
==============================================================================
--- trunk/Scribus/scribus/annotation.h (original)
+++ trunk/Scribus/scribus/annotation.h Mon Jun 10 15:36:31 2019
@@ -29,32 +29,24 @@
#include <QString>
#include "scribusapi.h"
-//FIXME: Someone please fix these variable names..
+//FIXME: Someone please fix these variable names..
//They are simply moved here, not all fixed.
//TODO make the usage in various places a little simpler
class SCRIBUS_API Annotation // : public SaxIO
{
public:
- //Do we need a null or an empty QString for these? Remove the qstring initialisations if null is ok.
- Annotation() : m_type(0), m_actType(0), m_action(""), m_E_act(""), m_X_act(""), m_D_act(""),
- m_Fo_act(""), m_Bl_act(""), m_K_act(""), m_F_act(""), m_V_act(""), m_C_act(""),
- m_toolTip(""), m_rollOver(""), m_down(""), m_borderColor(""), m_extern(""), m_borderStyle(0),
- m_borderWidth(1), m_feed(1), m_ziel(0), m_flag(0), m_maxChar(-1), m_vis(0), m_chkStil(0),
- m_font(4), m_isChk(false), m_aAact(false), m_html(0), m_useIcons(false),
- m_iPlace(1), m_scaleW(0), m_format(0), tmp_Chk(false), on_State(false), is_Open(false), m_icon(0), m_isOpen(false)
- {
- }
+ Annotation() = default;
enum AnnotationType
{
- Button = 2,
- Textfield = 3,
- Checkbox = 4,
- Combobox = 5,
- Listbox = 6,
- Text = 10,
- Link = 11,
- Annot3D = 12,
- RadioButton = 13
+ Button = 2,
+ Textfield = 3,
+ Checkbox = 4,
+ Combobox = 5,
+ Listbox = 6,
+ Text = 10,
+ Link = 11,
+ Annot3D = 12,
+ RadioButton = 13
};
enum AnnotationAction
{
@@ -119,16 +111,12 @@
bool isAcroFormField() const
{
- if (m_type == Annotation::Button ||
+ return m_type == Annotation::Button ||
m_type == Annotation::Textfield ||
m_type == Annotation::Checkbox ||
m_type == Annotation::Combobox ||
m_type == Annotation::Listbox ||
- m_type == Annotation::RadioButton)
- {
- return true;
- }
- return false;
+ m_type == Annotation::RadioButton;
}
void setType(int newType) { m_type = newType; }
@@ -209,46 +197,46 @@
int ScaleW() const { return m_scaleW; }
bool IsAnOpen() const { return m_isOpen; }
int Icon() const { return m_icon; }
-
+
protected:
- int m_type;
- int m_actType;
+ QString m_Bl_act;
+ QString m_C_act;
+ QString m_D_act;
+ QString m_E_act;
+ QString m_F_act;
+ QString m_Fo_act;
+ QString m_K_act;
+ QString m_V_act;
+ QString m_X_act;
QString m_action;
- QString m_E_act;
- QString m_X_act;
- QString m_D_act;
- QString m_Fo_act;
- QString m_Bl_act;
- QString m_K_act;
- QString m_F_act;
- QString m_V_act;
- QString m_C_act;
+ QString m_borderColor;
+ QString m_down;
+ QString m_extern;
+ QString m_rollOver;
QString m_toolTip;
- QString m_rollOver;
- QString m_down;
- QString m_borderColor;
- QString m_extern;
- int m_borderStyle;
- int m_borderWidth;
- int m_feed;
- int m_ziel;
- int m_flag;
- int m_maxChar;
- int m_vis;
- int m_chkStil;
- int m_font;
- bool m_isChk;
- bool m_aAact;
- int m_html;
- bool m_useIcons;
- int m_iPlace;
- int m_scaleW;
- int m_format;
- bool tmp_Chk;
- bool on_State;
- bool is_Open;
- int m_icon;
- bool m_isOpen;
+ bool is_Open {false};
+ bool m_aAact {false};
+ bool m_isChk {false};
+ bool m_isOpen {false};
+ bool m_useIcons {false};
+ bool on_State {false};
+ bool tmp_Chk {false};
+ int m_actType {0};
+ int m_borderStyle {0};
+ int m_borderWidth {1};
+ int m_chkStil {0};
+ int m_feed {1};
+ int m_flag {0};
+ int m_font {4};
+ int m_format {0};
+ int m_html {0};
+ int m_iPlace {1};
+ int m_icon {0};
+ int m_maxChar {-1};
+ int m_scaleW {0};
+ int m_type {0};
+ int m_vis {0};
+ int m_ziel {0};
};
#endif
Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp (original)
+++ trunk/Scribus/scribus/appmodehelper.cpp Mon Jun 10 15:36:31 2019
@@ -68,10 +68,9 @@
a_scrScrapActions=scSA;
a_scrLayersActions=scLA;
a_scrRecentPasteActions=scRPA;
-
-}
-
-void AppModeHelper::resetApplicationMode(ScribusMainWindow* scmw, int newMode)
+}
+
+void AppModeHelper::resetApplicationMode(int newMode)
{
a_actMgr->disconnectModeActions();
setModeActionsPerMode(newMode);
@@ -86,14 +85,13 @@
//If no doc and we end here, just reset the tool actions
if (doc==nullptr)
{
- resetApplicationMode(scmw, newMode);
+ resetApplicationMode(newMode);
return;
}
//disconnect the tools actions so we don't fire them off
a_actMgr->disconnectModeActions();
setModeActionsPerMode(newMode);
-
int oldMode = doc->appMode;
PageItem *currItem=nullptr;
@@ -1004,8 +1002,9 @@
void AppModeHelper::setActionGroupEnabled(QMap<QString, QPointer<ScrAction> >*ag, bool enabled)
{
- if (ag!=nullptr)
- for( QMap<QString, QPointer<ScrAction> >::Iterator it = ag->begin(); it!=ag->end(); ++it )
+ if (ag==nullptr)
+ return;
+ for( QMap<QString, QPointer<ScrAction> >::Iterator it = ag->begin(); it!=ag->end(); ++it )
(*it)->setEnabled(enabled);
}
Modified: trunk/Scribus/scribus/appmodehelper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/appmodehelper.h
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.h (original)
+++ trunk/Scribus/scribus/appmodehelper.h Mon Jun 10 15:36:31 2019
@@ -37,7 +37,7 @@
public:
explicit AppModeHelper(QObject *parent = nullptr);
void setup(ActionManager* am, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *);
- void resetApplicationMode(ScribusMainWindow* scmw, int newMode);
+ void resetApplicationMode(int newMode);
void setApplicationMode(ScribusMainWindow* scmw, ScribusDoc* doc, int newMode);
void enableActionsForSelection(ScribusMainWindow* scmw, ScribusDoc *doc);
void setModeActionsPerMode(int newMode);
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Mon Jun 10 15:36:31 2019
@@ -46,28 +46,6 @@
return p;
}
-
-void CanvasViewMode::init()
-{
- scale = 1;
-
- previewMode = false;
- viewAsPreview = false;
- previewVisual = -1;
-
- m_MouseButtonPressed = false;
- operItemMoving = false;
- operItemResizing = false;
- operItemSelecting = false;
- redrawPolygon.resize(0);
- linkedFramesToShow.clear();
-
- drawSelectedItemsWithControls = false;
- drawFramelinksWithContents = false;
-
- forceRedraw = false;
-}
-
QDataStream &operator<< ( QDataStream & ds, const CanvasViewMode & vm )
{
ds << vm.scale
@@ -110,9 +88,8 @@
setAutoFillBackground(true);
setAttribute(Qt::WA_OpaquePaintEvent, true);
setAttribute(Qt::WA_NoSystemBackground, true);
- m_buffer = /*QImage()*/QPixmap();
+ m_buffer = QPixmap();
m_bufferRect = QRect();
- m_viewMode.init();
m_renderMode = RENDER_NORMAL;
}
@@ -184,32 +161,32 @@
QPoint Canvas::canvasToLocal(const FPoint& p) const
{
- return QPoint(qRound((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale),
- qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale));
+ return {qRound((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale),
+ qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale)};
}
QPoint Canvas::canvasToLocal(QPointF p) const
{
- return QPoint(qRound((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale),
- qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale));
+ return {qRound((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale),
+ qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale)};
}
QRect Canvas::canvasToLocal(const QRectF& p) const
{
- return QRect(qRound((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale),
- qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale),
- qRound(p.width() * m_viewMode.scale),
- qRound(p.height() * m_viewMode.scale));
+ return {qRound((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale),
+ qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale),
+ qRound(p.width() * m_viewMode.scale),
+ qRound(p.height() * m_viewMode.scale)};
}
QRectF Canvas::canvasToLocalF(const QRectF& p) const
{
- return QRectF((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale,
- (p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale,
- p.width() * m_viewMode.scale,
- p.height() * m_viewMode.scale);
+ return {(p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale,
+ (p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale,
+ p.width() * m_viewMode.scale,
+ p.height() * m_viewMode.scale};
}
@@ -227,8 +204,8 @@
QRect Canvas::canvasToGlobal(const QRectF& p) const
{
- return QRect(mapToParent(QPoint(0,0) + canvasToLocal(p.topLeft())) + parentWidget()->mapToGlobal(QPoint(0, 0)),
- QSize(qRound(p.width() * m_viewMode.scale), qRound(p.height() * m_viewMode.scale)));
+ return {mapToParent(QPoint(0,0) + canvasToLocal(p.topLeft())) + parentWidget()->mapToGlobal(QPoint(0, 0)),
+ QSize(qRound(p.width() * m_viewMode.scale), qRound(p.height() * m_viewMode.scale))};
}
@@ -249,7 +226,7 @@
QRectF Canvas::globalToCanvas(QRect p) const
{
FPoint org = globalToCanvas(p.topLeft());
- return QRectF(org.x(), org.y(), p.width() / m_viewMode.scale, p.height() / m_viewMode.scale);
+ return {org.x(), org.y(), p.width() / m_viewMode.scale, p.height() / m_viewMode.scale};
}
@@ -271,8 +248,7 @@
QPoint localPoint1 = globalPoint - (mapToParent(QPoint(0,0)) + parentWidget()->mapToGlobal(QPoint(0, 0)));
QPoint localPoint2 = canvasToLocal(canvasPoint);
int radius = m_doc->guidesPrefs().grabRadius;
- return qAbs(localPoint1.x() - localPoint2.x()) < radius
- && qAbs(localPoint1.y() - localPoint2.y()) < radius;
+ return qAbs(localPoint1.x() - localPoint2.x()) < radius && qAbs(localPoint1.y() - localPoint2.y()) < radius;
}
@@ -281,26 +257,33 @@
QPoint localPoint1 = globalPoint - (mapToParent(QPoint(0,0)) + parentWidget()->mapToGlobal(QPoint(0, 0)));
QPoint localPoint2 = canvasToLocal(canvasPoint);
int radius = m_doc->guidesPrefs().grabRadius;
- return qAbs(localPoint1.x() - localPoint2.x()) < radius
- && qAbs(localPoint1.y() - localPoint2.y()) < radius;
+ return qAbs(localPoint1.x() - localPoint2.x()) < radius && qAbs(localPoint1.y() - localPoint2.y()) < radius;
}
bool Canvas::hitsCanvasPoint(const FPoint& globalPoint, const QPointF& canvasPoint) const
{
double radius = m_doc->guidesPrefs().grabRadius;
- return qAbs(globalPoint.x() - canvasPoint.x()) < radius
- && qAbs(globalPoint.y() - canvasPoint.y()) < radius;
+ return qAbs(globalPoint.x() - canvasPoint.x()) < radius && qAbs(globalPoint.y() - canvasPoint.y()) < radius;
}
QRect Canvas::exposedRect() const
{
- int ex ( -(x() / m_viewMode.scale) + m_doc->minCanvasCoordinate.x() );
- int ey ( -(y() / m_viewMode.scale) + m_doc->minCanvasCoordinate.y() );
- int ew ( (m_view->visibleWidth() * 1.2) / m_viewMode.scale );
- int eh ( (m_view->visibleHeight() * 1.2) / m_viewMode.scale );
+ int ex( -(x() / m_viewMode.scale) + m_doc->minCanvasCoordinate.x());
+ int ey( -(y() / m_viewMode.scale) + m_doc->minCanvasCoordinate.y());
+ int ew( (m_view->visibleWidth() * 1.2) / m_viewMode.scale);
+ int eh( (m_view->visibleHeight() * 1.2) / m_viewMode.scale);
- return QRect( ex, ey, ew, eh );
-}
+ return {ex, ey, ew, eh};
+}
+
+
+/// Little helper to calculate |p|^2
+
+static double length2(const QPointF& p)
+{
+ return p.x()*p.x() + p.y()*p.y();
+}
+
/*!
@@ -315,8 +298,7 @@
// be huge, into account.
// ### might be interesting to investigate if it would be painless to just change
// PageItem::getTransform.
- double extraS = 0.0;
- extraS = (item->visualHeight() - item->height()) / - 2.0;
+ double extraS = (item->visualHeight() - item->height()) / - 2.0;
// if (item->lineColor() != CommonStrings::None)
// extraS = (item->lineWidth() / -2.0);
if (item->isTextFrame() && (m_doc->appMode == modeEdit) && !item->asTextFrame()->availableRegion().contains(item->getTransform().inverted().map(canvasPoint.toPoint())))
@@ -328,15 +310,6 @@
// << QRectF(0, 0, item->width(), item->height());
return result;
}
-
-
-/// Little helper to calculate |p|^2
-
-static double length2(const QPointF& p)
-{
- return p.x()*p.x() + p.y()*p.y();
-}
-
Canvas::FrameHandle Canvas::frameHitTest(QPointF canvasPoint, const QRectF& frame) const
{
Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Mon Jun 10 15:36:31 2019
@@ -48,29 +48,23 @@
struct CanvasViewMode
{
- void init();
-
- double scale;
-
- bool previewMode;
- bool viewAsPreview;
- int previewVisual;
-
- bool m_MouseButtonPressed;
- bool operItemMoving;
- bool operItemResizing;
- bool operItemSelecting;
- bool operTextSelecting;
+ QList<PageItemPointer> linkedFramesToShow;
QPolygon redrawPolygon;
- QList<PageItemPointer> linkedFramesToShow;
-
+ bool m_MouseButtonPressed {false};
+ bool operItemMoving {false};
+ bool operItemResizing {false};
+ bool operItemSelecting {false};
+ bool operTextSelecting {false};
+ bool previewMode {false};
+ bool viewAsPreview {false};
/** if true, selected objects will not be drawn by drawContents() */
- bool drawSelectedItemsWithControls;
+ bool drawSelectedItemsWithControls {false};
/** if true, drawContents() will draw framelinks even if View->Show Framelinks is false */
- bool drawFramelinksWithContents;
-
+ bool drawFramelinksWithContents {false};
// used for buffering:
- bool forceRedraw;
+ bool forceRedraw {false};
+ double scale {1};
+ int previewVisual {-1};
};
QDataStream &operator<<(QDataStream & ds, const CanvasViewMode & vm);
@@ -170,8 +164,8 @@
bool cursorOverTextFrameControl(QPoint globalPos, PageItem* frame);
bool cursorOverFrameControl(QPoint globalPos, const QRectF& targetRect, PageItem* frame);
/** Returns the framehandle or INSIDE if the position falls into the frame. */
- FrameHandle frameHitTest(QPointF canvasPoint, PageItem* frame) const;
- FrameHandle frameHitTest(QPointF point, const QRectF& frame) const;
+ FrameHandle frameHitTest(QPointF canvasPoint, PageItem* item) const;
+ FrameHandle frameHitTest(QPointF canvasPoint, const QRectF& frame) const;
/**
Returns the item under the cursor or nullptr if none found.
Does *not* change the selection.
@@ -201,7 +195,7 @@
void DrawMasterItems(ScPainter *painter, ScPage *page, ScLayer& layer, QRect clip);
//notesFramesPass determine if notes frames are drawed or not
void DrawPageItems(ScPainter *painter, ScLayer& layer, QRect clip, bool notesFramesPass);
- virtual void paintEvent ( QPaintEvent * p );
+ void paintEvent ( QPaintEvent * p ) override;
void displayXYHUD(QPoint m);
void displayCorrectedXYHUD(QPoint m, double x, double y);
void displayCorrectedSingleHUD(QPoint m, double val, bool isX);
@@ -232,8 +226,8 @@
void DrawPageIndicatorSub(ScPainter *p, ScPage *page);
void DrawPageIndicator(ScPainter *p, const QRectF& clip, bool master = false);
void drawLinkFrameLine(ScPainter* painter, FPoint &start, FPoint &end);
- void PaintSizeRect(QRect neu);
- void PaintSizeRect(QPolygon neu);
+ void PaintSizeRect(QRect newRect);
+ void PaintSizeRect(QPolygon newRect);
void Transform(PageItem *currItem, QPainter *p);
void Transform(PageItem *currItem, QTransform& m);
void TransformM(PageItem *currItem, QPainter *p);
Modified: trunk/Scribus/scribus/canvasgesture.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture.h (original)
+++ trunk/Scribus/scribus/canvasgesture.h Mon Jun 10 15:36:31 2019
@@ -50,28 +50,28 @@
protected:
explicit CanvasGesture (CanvasMode* parent) : CanvasMode(parent->view()), m_delegate(parent) {};
- explicit CanvasGesture (ScribusView* view) : CanvasMode(view), m_delegate(NULL) {};
+ explicit CanvasGesture (ScribusView* view) : CanvasMode(view), m_delegate(nullptr) {};
public:
- virtual ~CanvasGesture() {}
- virtual void enterEvent(QEvent * e) { m_delegate->enterEvent(e); }
- virtual void leaveEvent(QEvent * e) { m_delegate->leaveEvent(e); }
+ ~CanvasGesture() override = default;
+ void enterEvent(QEvent * e) override { m_delegate->enterEvent(e); }
+ void leaveEvent(QEvent * e) override { m_delegate->leaveEvent(e); }
- virtual void dragEnterEvent(QDragEnterEvent *e) { m_delegate->dragEnterEvent(e); }
- virtual void dragMoveEvent(QDragMoveEvent *e) { m_delegate->dragMoveEvent(e); }
- virtual void dragLeaveEvent(QDragLeaveEvent *e) { m_delegate->dragLeaveEvent(e); }
- virtual void dropEvent(QDropEvent *e) { m_delegate->dropEvent(e); }
+ void dragEnterEvent(QDragEnterEvent *e) override { m_delegate->dragEnterEvent(e); }
+ void dragMoveEvent(QDragMoveEvent *e) override { m_delegate->dragMoveEvent(e); }
+ void dragLeaveEvent(QDragLeaveEvent *e) override { m_delegate->dragLeaveEvent(e); }
+ void dropEvent(QDropEvent *e) override { m_delegate->dropEvent(e); }
- virtual void mouseDoubleClickEvent(QMouseEvent *m) { m_delegate->mouseDoubleClickEvent(m); }
- virtual void mouseReleaseEvent(QMouseEvent *m) { m_delegate->mouseReleaseEvent(m); }
- virtual void mouseMoveEvent(QMouseEvent *m) { m_delegate->mouseMoveEvent(m); }
- virtual void mousePressEvent(QMouseEvent *m) { m_delegate->mousePressEvent(m); }
+ void mouseDoubleClickEvent(QMouseEvent *m) override { m_delegate->mouseDoubleClickEvent(m); }
+ void mouseReleaseEvent(QMouseEvent *m) override { m_delegate->mouseReleaseEvent(m); }
+ void mouseMoveEvent(QMouseEvent *m) override { m_delegate->mouseMoveEvent(m); }
+ void mousePressEvent(QMouseEvent *m) override { m_delegate->mousePressEvent(m); }
- virtual void keyPressEvent(QKeyEvent *e) { m_delegate->keyPressEvent(e); }
- virtual void keyReleaseEvent(QKeyEvent *e) { m_delegate->keyReleaseEvent(e); }
- virtual void inputMethodEvent(QInputMethodEvent *e) { m_delegate->inputMethodEvent(e); }
+ void keyPressEvent(QKeyEvent *e) override { m_delegate->keyPressEvent(e); }
+ void keyReleaseEvent(QKeyEvent *e) override { m_delegate->keyReleaseEvent(e); }
+ void inputMethodEvent(QInputMethodEvent *e) override { m_delegate->inputMethodEvent(e); }
- CanvasMode* delegate() { return m_delegate; }
+ CanvasMode* delegate() override { return m_delegate; }
void setDelegate(CanvasMode* delegate) { if (delegate) m_delegate = delegate; }
protected:
Modified: trunk/Scribus/scribus/canvasgesture_cellselect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_cellselect.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_cellselect.h (original)
+++ trunk/Scribus/scribus/canvasgesture_cellselect.h Mon Jun 10 15:36:31 2019
@@ -34,16 +34,16 @@
public:
explicit CellSelect(CanvasMode* parent) : TableGesture(parent) {}
- virtual ~CellSelect() {}
+ ~CellSelect() override = default;
- virtual void activate(bool fromGesture);
- virtual void deactivate(bool forGesture);
- virtual void keyPressEvent(QKeyEvent* event);
- virtual void mousePressEvent(QMouseEvent* event);
- virtual void mouseReleaseEvent(QMouseEvent* event);
- virtual void mouseMoveEvent(QMouseEvent* event);
- virtual bool handleKeyEvents() { return true; }
- virtual void drawControls(QPainter* p);
+ void activate(bool fromGesture) override;
+ void deactivate(bool forGesture) override;
+ void keyPressEvent(QKeyEvent* event) override;
+ void mousePressEvent(QMouseEvent* event) override;
+ void mouseReleaseEvent(QMouseEvent* event) override;
+ void mouseMoveEvent(QMouseEvent* event) override;
+ bool handleKeyEvents() override { return true; }
+ void drawControls(QPainter* p) override;
/// Sets up this gesture to select cells in @a table, starting with @a cell.
void setup(PageItem_Table* table, const TableCell& cell);
Modified: trunk/Scribus/scribus/canvasgesture_columnresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_columnresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_columnresize.h (original)
+++ trunk/Scribus/scribus/canvasgesture_columnresize.h Mon Jun 10 15:36:31 2019
@@ -32,16 +32,16 @@
public:
explicit ColumnResize(CanvasMode* parent) : TableGesture(parent), m_column(0) {}
- virtual ~ColumnResize() {}
+ ~ColumnResize() override = default;
- virtual void activate(bool fromGesture) {};
- virtual void deactivate(bool forGesture) {}
- virtual void keyPressEvent(QKeyEvent* event);
- virtual void keyReleaseEvent(QKeyEvent* event);
- virtual void mouseReleaseEvent(QMouseEvent* event);
- virtual void mouseMoveEvent(QMouseEvent* event);
- virtual bool handleKeyEvents() { return true; }
- virtual void drawControls(QPainter* p);
+ void activate(bool fromGesture) override {};
+ void deactivate(bool forGesture) override {}
+ void keyPressEvent(QKeyEvent* event) override;
+ void keyReleaseEvent(QKeyEvent* event) override;
+ void mouseReleaseEvent(QMouseEvent* event) override;
+ void mouseMoveEvent(QMouseEvent* event) override;
+ bool handleKeyEvents() override { return true; }
+ void drawControls(QPainter* p) override;
/// Sets up this column resize gesture to resize @a column in @a table.
void setup(PageItem_Table* table, int column);
Modified: trunk/Scribus/scribus/canvasgesture_linemove.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_linemove.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_linemove.h (original)
+++ trunk/Scribus/scribus/canvasgesture_linemove.h Mon Jun 10 15:36:31 2019
@@ -49,8 +49,8 @@
class SCRIBUS_API LineMove : public CanvasGesture
{
public:
- explicit LineMove (CanvasMode* parent): CanvasGesture(parent), m_haveLineItem(false), m_useOriginAsEndpoint(false), m_bounds(0,0,0,0), m_line(NULL) {}
- virtual ~LineMove() {}
+ explicit LineMove (CanvasMode* parent): CanvasGesture(parent), m_haveLineItem(false), m_useOriginAsEndpoint(false), m_bounds(0,0,0,0), m_line(nullptr) {}
+ ~LineMove() override = default;
/**
Prepare a LineMove without attached PageItem
@@ -64,19 +64,19 @@
void clear();
- virtual void activate(bool);
- virtual void deactivate(bool);
- virtual void mouseReleaseEvent(QMouseEvent *m);
- virtual void mouseMoveEvent(QMouseEvent *m);
+ void activate(bool) override;
+ void deactivate(bool) override;
+ void mouseReleaseEvent(QMouseEvent *m) override;
+ void mouseMoveEvent(QMouseEvent *m) override;
/**
prepares the LineMove for the the current selection. Sets 'haveLineItem'
to false if the current selection is not a single lineitem.
*/
- virtual void mousePressEvent(QMouseEvent *m);
- virtual void drawControls(QPainter*);
+ void mousePressEvent(QMouseEvent *m) override;
+ void drawControls(QPainter*) override;
- void setStartPoint(QPointF canvasStart);
- void setEndPoint(QPointF canvasEnd);
+ void setStartPoint(QPointF p);
+ void setEndPoint(QPointF p);
QPointF startPoint() const { return m_bounds.topLeft(); }
QPointF endPoint() const { return m_bounds.bottomRight(); }
Modified: trunk/Scribus/scribus/canvasgesture_pan.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_pan.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_pan.h (original)
+++ trunk/Scribus/scribus/canvasgesture_pan.h Mon Jun 10 15:36:31 2019
@@ -27,15 +27,15 @@
{
public:
explicit PanGesture (CanvasMode* parent);
- virtual ~PanGesture() {}
+ ~PanGesture() override = default;
- virtual void activate(bool);
- virtual void deactivate(bool);
- virtual void mouseReleaseEvent(QMouseEvent *m);
- virtual void mouseMoveEvent(QMouseEvent *m);
+ void activate(bool) override;
+ void deactivate(bool) override;
+ void mouseReleaseEvent(QMouseEvent *m) override;
+ void mouseMoveEvent(QMouseEvent *m) override;
- virtual void mousePressEvent(QMouseEvent *m);
- virtual void drawControls(QPainter*);
+ void mousePressEvent(QMouseEvent *m) override;
+ void drawControls(QPainter*) override;
private:
QCursor m_cursor;
Modified: trunk/Scribus/scribus/canvasgesture_rectselect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_rectselect.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rectselect.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_rectselect.cpp Mon Jun 10 15:36:31 2019
@@ -36,14 +36,14 @@
void RectSelect::leaveEvent(QEvent * e){}
-void RectSelect::prepare(QPoint start)
+void RectSelect::prepare(QPoint globalStartPos)
{
if (!m_selectionRubberBand)
m_selectionRubberBand = new SelectionRubberBand(QRubberBand::Rectangle, m_view);
- setStart(start);
+ setStart(globalStartPos);
//FIXME Move to new code like SelectionRubberBand
m_selectionRubberBand->setWindowOpacity(0.5);
- m_selectionRubberBand->setGeometry(QRect(m_view->mapFromGlobal(start), m_view->mapFromGlobal(start)));
+ m_selectionRubberBand->setGeometry(QRect(m_view->mapFromGlobal(globalStartPos), m_view->mapFromGlobal(globalStartPos)));
}
void RectSelect::clear()
Modified: trunk/Scribus/scribus/canvasgesture_rectselect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_rectselect.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rectselect.h (original)
+++ trunk/Scribus/scribus/canvasgesture_rectselect.h Mon Jun 10 15:36:31 2019
@@ -48,26 +48,26 @@
class SCRIBUS_API RectSelect : public CanvasGesture
{
public:
- explicit RectSelect (CanvasMode* parent) : CanvasGesture(parent), m_start(0,0), m_selectionRubberBand(0) {};
- virtual ~RectSelect() {}
+ explicit RectSelect (CanvasMode* parent) : CanvasGesture(parent), m_start(0,0), m_selectionRubberBand(nullptr) {};
+ ~RectSelect() override = default;
void prepare(QPoint globalStartPos);
void clear();
- virtual void enterEvent(QEvent * e);
- virtual void leaveEvent(QEvent * e);
-
- virtual void activate(bool);
- virtual void deactivate(bool);
- virtual void mouseReleaseEvent(QMouseEvent *m);
- virtual void mouseMoveEvent(QMouseEvent *m);
+ void enterEvent(QEvent * e) override;
+ void leaveEvent(QEvent * e) override;
+ void activate(bool) override;
+ void deactivate(bool) override;
+ void mouseReleaseEvent(QMouseEvent *m) override;
+ void mouseMoveEvent(QMouseEvent *m) override;
/**
Prepares rectangle select for the position from 'm'
*/
- virtual void mousePressEvent(QMouseEvent *m);
- virtual void drawControls(QPainter*);
+ void mousePressEvent(QMouseEvent *m) override;
+ void drawControls(QPainter*) override;
QRectF result() const ;
+
private:
void setStart(QPoint globalPos);
void setEnd(QPoint globalPos);
Modified: trunk/Scribus/scribus/canvasgesture_resize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_resize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.h (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.h Mon Jun 10 15:36:31 2019
@@ -48,7 +48,7 @@
{
public:
explicit ResizeGesture (CanvasMode* parent);
- virtual ~ResizeGesture() {}
+ ~ResizeGesture() override = default;
/**
Prepares the gesture for resizing the selection
@@ -56,17 +56,17 @@
void prepare(Canvas::FrameHandle framehandle = Canvas::SOUTHEAST);
void clear();
- virtual void drawControls(QPainter* p);
- virtual void activate(bool);
- virtual void deactivate(bool);
- virtual void mouseReleaseEvent(QMouseEvent *m);
- virtual void mouseMoveEvent(QMouseEvent *m);
+ void drawControls(QPainter* p) override;
+ void activate(bool) override;
+ void deactivate(bool) override;
+ void mouseReleaseEvent(QMouseEvent *m) override;
+ void mouseMoveEvent(QMouseEvent *m) override;
/**
This method only sets the m_handle field.
If the correct value is set by prepare() (default = SOUTHEAST),
it's not necessary to call this method.
*/
- virtual void mousePressEvent(QMouseEvent *m);
+ void mousePressEvent(QMouseEvent *m) override;
Canvas::FrameHandle frameHandle() const { return m_handle; }
Modified: trunk/Scribus/scribus/canvasgesture_rowresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_rowresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rowresize.h (original)
+++ trunk/Scribus/scribus/canvasgesture_rowresize.h Mon Jun 10 15:36:31 2019
@@ -32,16 +32,16 @@
public:
explicit RowResize(CanvasMode* parent) : TableGesture(parent), m_row(0) {}
- virtual ~RowResize() {}
+ ~RowResize() override = default;
- virtual void activate(bool fromGesture) {};
- virtual void deactivate(bool forGesture) {}
- virtual void keyPressEvent(QKeyEvent* event);
- virtual void keyReleaseEvent(QKeyEvent* event);
- virtual void mouseReleaseEvent(QMouseEvent* event);
- virtual void mouseMoveEvent(QMouseEvent* event);
- virtual bool handleKeyEvents() { return true; }
- virtual void drawControls(QPainter* p);
+ void activate(bool fromGesture) override {};
+ void deactivate(bool forGesture) override {}
+ void keyPressEvent(QKeyEvent* event) override;
+ void keyReleaseEvent(QKeyEvent* event) override;
+ void mouseReleaseEvent(QMouseEvent* event) override;
+ void mouseMoveEvent(QMouseEvent* event) override;
+ bool handleKeyEvents() override { return true; }
+ void drawControls(QPainter* p) override;
/// Sets up this row resize gesture to resize @a row in @a table.
void setup(PageItem_Table* table, int row);
Modified: trunk/Scribus/scribus/canvasgesture_rulermove.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_rulermove.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rulermove.h (original)
+++ trunk/Scribus/scribus/canvasgesture_rulermove.h Mon Jun 10 15:36:31 2019
@@ -49,7 +49,7 @@
public:
enum Mode { HORIZONTAL, VERTICAL, ORIGIN };
RulerGesture (ScribusView* view, Mode mode);
- virtual ~RulerGesture() {}
+ ~RulerGesture() override = default;
/**
Prepares the gesture for 'mode' without using an existing guide. If 'mode' is HORIZONTAL
@@ -58,16 +58,16 @@
void prepare(Mode mode);
void clear();
- virtual void drawControls(QPainter* p);
- virtual void activate(bool);
- virtual void deactivate(bool);
- virtual void mouseReleaseEvent(QMouseEvent *m);
- virtual void mouseMoveEvent(QMouseEvent *m);
+ void drawControls(QPainter* p) override;
+ void activate(bool) override;
+ void deactivate(bool) override;
+ void mouseReleaseEvent(QMouseEvent *m) override;
+ void mouseMoveEvent(QMouseEvent *m) override;
/**
This method should be called when the mousebutton is pressed.
If there's a moveable guide near this position, it prepares the gesture for moving this guide.
*/
- virtual void mousePressEvent(QMouseEvent *m);
+ void mousePressEvent(QMouseEvent *m) override;
Mode getMode() { return m_mode; }
/**
Modified: trunk/Scribus/scribus/canvasgesture_table.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_table.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_table.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_table.cpp Mon Jun 10 15:36:31 2019
@@ -23,7 +23,7 @@
#include "canvasgesture_table.h"
-QPointF TableGesture::globalToTableGrid(const QPoint point, bool snap)
+QPointF TableGesture::globalToTableGrid(const QPoint& point, bool snap)
{
FPoint canvasPoint = m_canvas->globalToCanvas(point);
@@ -32,7 +32,7 @@
// Snap to grid and guides.
canvasPoint = m_doc->ApplyGridF(canvasPoint);
m_doc->ApplyGuides(&canvasPoint);
- m_doc->ApplyGuides(&canvasPoint,true);
+ m_doc->ApplyGuides(&canvasPoint, true);
}
// Return point mapped to table grid.
Modified: trunk/Scribus/scribus/canvasgesture_table.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_table.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_table.h (original)
+++ trunk/Scribus/scribus/canvasgesture_table.h Mon Jun 10 15:36:31 2019
@@ -32,11 +32,11 @@
Q_OBJECT
public:
- virtual ~TableGesture() {}
+ ~TableGesture() override = default;
protected:
- explicit TableGesture(CanvasMode* parent) : CanvasGesture(parent->view()), m_table(0) {};
- explicit TableGesture(ScribusView* view) : CanvasGesture(view), m_table(0) {};
+ explicit TableGesture(CanvasMode* parent) : CanvasGesture(parent->view()), m_table(nullptr) {};
+ explicit TableGesture(ScribusView* view) : CanvasGesture(view), m_table(nullptr) {};
/// Returns the currently edited table.
PageItem_Table* table() const { return m_table; }
@@ -49,7 +49,7 @@
* on the table grid of the currently edited table. If @a snap is <code>true</code>,
* @a point is first snapped to the page grid and guides, in that order.
*/
- QPointF globalToTableGrid(const QPoint point, bool snap = true);
+ QPointF globalToTableGrid(const QPoint& point, bool snap = true);
/**
* Paints the outline of the currently edited table.
@@ -60,7 +60,7 @@
* or the result of this function is undefined.
*/
void paintTableOutline(const QList<double>& rowHeights, const QList<double>& rowPositions,
- const QList<double>& columnWidths, const QList<double>& columnPositions, QPainter* p);
+ const QList<double>& columnWidths, const QList<double>& columnPositions, QPainter* p);
/**
* Paints the selection of the currently edited table.
Modified: trunk/Scribus/scribus/canvasgesture_tableresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasgesture_tableresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_tableresize.h (original)
+++ trunk/Scribus/scribus/canvasgesture_tableresize.h Mon Jun 10 15:36:31 2019
@@ -31,17 +31,16 @@
Q_OBJECT
public:
- explicit TableResize(CanvasMode* parent) : TableGesture(parent),
- m_minHeight(0.0), m_minWidth(0.0) {}
- virtual ~TableResize() {}
+ explicit TableResize(CanvasMode* parent) : TableGesture(parent), m_minHeight(0.0), m_minWidth(0.0) {}
+ ~TableResize() override = default;
- virtual void activate(bool fromGesture) {};
- virtual void deactivate(bool forGesture) {}
- virtual void keyPressEvent(QKeyEvent* event);
- virtual void mouseReleaseEvent(QMouseEvent* event);
- virtual void mouseMoveEvent(QMouseEvent* event);
- virtual bool handleKeyEvents() { return true; }
- virtual void drawControls(QPainter* p);
+ void activate(bool fromGesture) override {};
+ void deactivate(bool forGesture) override {}
+ void keyPressEvent(QKeyEvent* event) override;
+ void mouseReleaseEvent(QMouseEvent* event) override;
+ void mouseMoveEvent(QMouseEvent* event) override;
+ bool handleKeyEvents() override { return true; }
+ void drawControls(QPainter* p) override;
/// Sets up this table resize gesture to resize @a table.
void setup(PageItem_Table* table);
Modified: trunk/Scribus/scribus/canvasmode_copyproperties.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_copyproperties.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_copyproperties.h (original)
+++ trunk/Scribus/scribus/canvasmode_copyproperties.h Mon Jun 10 15:36:31 2019
@@ -30,7 +30,7 @@
{
public:
explicit CanvasMode_CopyProperties(ScribusView* view);
- ~CanvasMode_CopyProperties() override {}
+ ~CanvasMode_CopyProperties() override = default;
void enterEvent(QEvent *) override ;
void leaveEvent(QEvent *) override ;
Modified: trunk/Scribus/scribus/canvasmode_create.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_create.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.h (original)
+++ trunk/Scribus/scribus/canvasmode_create.h Mon Jun 10 15:36:31 2019
@@ -36,7 +36,7 @@
public:
explicit CreateMode(ScribusView* view);
- ~CreateMode() override {}
+ ~CreateMode() override = default;
void enterEvent(QEvent *) override ;
void leaveEvent(QEvent *) override ;
Modified: trunk/Scribus/scribus/canvasmode_drawbezier.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_drawbezier.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawbezier.h (original)
+++ trunk/Scribus/scribus/canvasmode_drawbezier.h Mon Jun 10 15:36:31 2019
@@ -33,7 +33,7 @@
{
public:
explicit BezierMode(ScribusView* view);
- ~BezierMode() override {}
+ ~BezierMode() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.h (original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.h Mon Jun 10 15:36:31 2019
@@ -33,7 +33,7 @@
{
public:
explicit CalligraphicMode(ScribusView* view);
- ~CalligraphicMode() override {}
+ ~CalligraphicMode() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.h (original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.h Mon Jun 10 15:36:31 2019
@@ -33,7 +33,7 @@
{
public:
explicit FreehandMode(ScribusView* view);
- ~FreehandMode() {}
+ ~FreehandMode() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_edit.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_edit.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edit.h (original)
+++ trunk/Scribus/scribus/canvasmode_edit.h Mon Jun 10 15:36:31 2019
@@ -38,7 +38,7 @@
public:
explicit CanvasMode_Edit(ScribusView* view);
- ~CanvasMode_Edit() {}
+ ~CanvasMode_Edit() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_editarc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_editarc.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.h (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.h Mon Jun 10 15:36:31 2019
@@ -43,7 +43,7 @@
public:
explicit CanvasMode_EditArc(ScribusView* view);
- ~CanvasMode_EditArc() override {}
+ ~CanvasMode_EditArc() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
@@ -55,7 +55,7 @@
void mouseMoveEvent(QMouseEvent *m) override;
void mousePressEvent(QMouseEvent *m) override;
void drawControls(QPainter* p) override;
- void drawControlsArc(QPainter* pp, PageItem* currItem);
+ void drawControlsArc(QPainter* psx, PageItem* currItem);
private:
Modified: trunk/Scribus/scribus/canvasmode_editgradient.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_editgradient.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.h (original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.h Mon Jun 10 15:36:31 2019
@@ -36,7 +36,7 @@
{
public:
explicit CanvasMode_EditGradient(ScribusView* view);
- ~CanvasMode_EditGradient() override {}
+ ~CanvasMode_EditGradient() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.h (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.h Mon Jun 10 15:36:31 2019
@@ -56,7 +56,7 @@
void keyPressEvent(QKeyEvent *e) override;
bool handleKeyEvents() override { return true; }
void drawControls(QPainter* p) override;
- void drawControlsMeshGradient(QPainter* pp, PageItem* currItem);
+ void drawControlsMeshGradient(QPainter* psx, PageItem* currItem);
private:
Modified: trunk/Scribus/scribus/canvasmode_editmeshpatch.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_editmeshpatch.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshpatch.h (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshpatch.h Mon Jun 10 15:36:31 2019
@@ -58,7 +58,7 @@
bool handleKeyEvents() override { return true; }
void drawControls(QPainter* p) override;
void drawControlsMeshPoint(QPainter* psx, const MeshPoint& mp, bool isSelected);
- void drawControlsMeshPatch(QPainter* pp, PageItem* currItem);
+ void drawControlsMeshPatch(QPainter* psx, PageItem* currItem);
private:
void snapToOtherPatch(double &x, double &y);
Modified: trunk/Scribus/scribus/canvasmode_editpolygon.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_editpolygon.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.h (original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.h Mon Jun 10 15:36:31 2019
@@ -43,7 +43,7 @@
Q_OBJECT
public:
explicit CanvasMode_EditPolygon(ScribusView* view);
- ~CanvasMode_EditPolygon() override {}
+ ~CanvasMode_EditPolygon() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
@@ -55,7 +55,7 @@
void mouseMoveEvent(QMouseEvent *m) override;
void mousePressEvent(QMouseEvent *m) override;
void drawControls(QPainter* p) override;
- void drawControlsPolygon(QPainter* pp, PageItem* currItem);
+ void drawControlsPolygon(QPainter* psx, PageItem* currItem);
private:
Modified: trunk/Scribus/scribus/canvasmode_editspiral.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_editspiral.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editspiral.h (original)
+++ trunk/Scribus/scribus/canvasmode_editspiral.h Mon Jun 10 15:36:31 2019
@@ -43,7 +43,7 @@
Q_OBJECT
public:
explicit CanvasMode_EditSpiral(ScribusView* view);
- ~CanvasMode_EditSpiral() override {}
+ ~CanvasMode_EditSpiral() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
@@ -55,7 +55,7 @@
void mouseMoveEvent(QMouseEvent *m) override;
void mousePressEvent(QMouseEvent *m) override;
void drawControls(QPainter* p) override;
- void drawControlsSpiral(QPainter* pp, PageItem* currItem);
+ void drawControlsSpiral(QPainter* psx, PageItem* currItem);
private:
Modified: trunk/Scribus/scribus/canvasmode_editweldpoint.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_editweldpoint.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editweldpoint.h (original)
+++ trunk/Scribus/scribus/canvasmode_editweldpoint.h Mon Jun 10 15:36:31 2019
@@ -43,7 +43,7 @@
Q_OBJECT
public:
explicit CanvasMode_EditWeldPoint(ScribusView* view);
- ~CanvasMode_EditWeldPoint() override {}
+ ~CanvasMode_EditWeldPoint() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
@@ -57,7 +57,7 @@
void keyPressEvent(QKeyEvent *e) override;
bool handleKeyEvents() override { return true; }
void drawControls(QPainter* p) override;
- void drawControlsWeldPoint(QPainter* pp, PageItem* currItem);
+ void drawControlsWeldPoint(QPainter* psx, PageItem* currItem);
private:
void snapToEdgePoints(double &x, double &y);
Modified: trunk/Scribus/scribus/canvasmode_eyedropper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_eyedropper.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.h (original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.h Mon Jun 10 15:36:31 2019
@@ -30,7 +30,7 @@
public:
explicit CanvasMode_EyeDropper(ScribusView* view);
- ~CanvasMode_EyeDropper() override {}
+ ~CanvasMode_EyeDropper() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_framelinks.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_framelinks.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_framelinks.h (original)
+++ trunk/Scribus/scribus/canvasmode_framelinks.h Mon Jun 10 15:36:31 2019
@@ -41,7 +41,7 @@
public:
explicit CanvasMode_FrameLinks(ScribusView* view);
- ~CanvasMode_FrameLinks() override {}
+ ~CanvasMode_FrameLinks() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_imageimport.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_imageimport.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_imageimport.h (original)
+++ trunk/Scribus/scribus/canvasmode_imageimport.h Mon Jun 10 15:36:31 2019
@@ -35,7 +35,7 @@
public:
explicit CanvasMode_ImageImport(ScribusView* view);
- ~CanvasMode_ImageImport() override {}
+ ~CanvasMode_ImageImport() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_magnifier.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_magnifier.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_magnifier.h (original)
+++ trunk/Scribus/scribus/canvasmode_magnifier.h Mon Jun 10 15:36:31 2019
@@ -38,7 +38,7 @@
{
public:
explicit CanvasMode_Magnifier(ScribusView* view);
- ~CanvasMode_Magnifier() override {}
+ ~CanvasMode_Magnifier() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_measurements.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_measurements.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_measurements.h (original)
+++ trunk/Scribus/scribus/canvasmode_measurements.h Mon Jun 10 15:36:31 2019
@@ -36,7 +36,7 @@
public:
explicit MeasurementsMode(ScribusView* view);
- ~MeasurementsMode() override {}
+ ~MeasurementsMode() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_nodeedit.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_nodeedit.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.h (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.h Mon Jun 10 15:36:31 2019
@@ -54,10 +54,10 @@
/**
Draws the controls for this mode
*/
- virtual void drawControls(QPainter* p);
+ void drawControls(QPainter* p) override;
- virtual ~CanvasMode_NodeEdit() {};
+ ~CanvasMode_NodeEdit() override = default;
private:
Modified: trunk/Scribus/scribus/canvasmode_normal.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_normal.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.h (original)
+++ trunk/Scribus/scribus/canvasmode_normal.h Mon Jun 10 15:36:31 2019
@@ -40,7 +40,7 @@
public:
explicit CanvasMode_Normal(ScribusView* view);
- ~CanvasMode_Normal() override {}
+ ~CanvasMode_Normal() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_panning.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_panning.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_panning.h (original)
+++ trunk/Scribus/scribus/canvasmode_panning.h Mon Jun 10 15:36:31 2019
@@ -35,7 +35,7 @@
{
public:
explicit CanvasMode_Panning(ScribusView* view);
- ~CanvasMode_Panning() override {}
+ ~CanvasMode_Panning() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/canvasmode_rotate.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/canvasmode_rotate.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_rotate.h (original)
+++ trunk/Scribus/scribus/canvasmode_rotate.h Mon Jun 10 15:36:31 2019
@@ -36,7 +36,7 @@
{
public:
explicit CanvasMode_Rotate(ScribusView* view);
- ~CanvasMode_Rotate() override {}
+ ~CanvasMode_Rotate() override = default;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
Modified: trunk/Scribus/scribus/cellarea.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/cellarea.cpp
==============================================================================
--- trunk/Scribus/scribus/cellarea.cpp (original)
+++ trunk/Scribus/scribus/cellarea.cpp Mon Jun 10 15:36:31 2019
@@ -10,11 +10,6 @@
#include <QDebug>
#include "cellarea.h"
-
-CellArea::CellArea() :
- m_row(-1), m_column(-1), m_width(-1), m_height(-1)
-{
-}
CellArea::CellArea(int row, int column, int width, int height) :
m_row(row), m_column(column), m_width(width), m_height(height)
Modified: trunk/Scribus/scribus/cellarea.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/cellarea.h
==============================================================================
--- trunk/Scribus/scribus/cellarea.h (original)
+++ trunk/Scribus/scribus/cellarea.h Mon Jun 10 15:36:31 2019
@@ -23,7 +23,7 @@
{
public:
/// Constructs a new invalid area.
- CellArea();
+ CellArea() = default;
/// Constructs an area starting at @a row, @a column with the given @a width and @a height.
CellArea(int row, int column, int width, int height);
@@ -122,10 +122,10 @@
CellArea adjustedForColumnRemoval(int index, int numColumns);
private:
- int m_row;
- int m_column;
- int m_width;
- int m_height;
+ int m_row {-1};
+ int m_column {-1};
+ int m_width {-1};
+ int m_height {-1};
};
Q_DECLARE_TYPEINFO(CellArea, Q_MOVABLE_TYPE);
Modified: trunk/Scribus/scribus/chartablemodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/chartablemodel.cpp
==============================================================================
--- trunk/Scribus/scribus/chartablemodel.cpp (original)
+++ trunk/Scribus/scribus/chartablemodel.cpp Mon Jun 10 15:36:31 2019
@@ -16,7 +16,6 @@
: QAbstractTableModel(parent),
m_doc(doc),
m_cols(cols),
- m_viewWidth(200),
m_fontInUse(font)
{
m_selectionModel = new QItemSelectionModel(this);
Modified: trunk/Scribus/scribus/chartablemodel.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/chartablemodel.h
==============================================================================
--- trunk/Scribus/scribus/chartablemodel.h (original)
+++ trunk/Scribus/scribus/chartablemodel.h Mon Jun 10 15:36:31 2019
@@ -32,13 +32,14 @@
Q_OBJECT
public:
- CharTableModel(QObject *parent = 0, int cols = 4, ScribusDoc * doc = 0, const QString & font = 0);
+ CharTableModel(QObject* parent = nullptr, int cols = 4, ScribusDoc* doc = nullptr, const QString & font = nullptr);
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex& parent = QModelIndex()) const override;
//! \brief Get a graphics representation/pixmap of the glyph
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ QVariant data(const QModelIndex& index,
+ int role = Qt::DisplayRole) const override;
void setFontInUse(const QString& font);
@@ -48,10 +49,7 @@
void setCharacters(const CharClassDef& ch);
void setCharactersAndFonts(const CharClassDef& ch, const QStringList& fonts);
void addCharacter(const QString& ch);
- CharClassDef characters() {
- return m_characters;
- }
-
+ CharClassDef characters() { return m_characters; }
QStringList fonts() { return m_fonts; }
//! \brief called to erase glyph at index from table.
@@ -93,7 +91,7 @@
//! \brief Number of the columns for model
int m_cols;
//! \brief View's width to compute pixmap sizes.
- int m_viewWidth;
+ int m_viewWidth {200};
QString m_fontInUse;
CharClassDef m_characters;
@@ -105,11 +103,11 @@
/*! \brief All drag'n'drop actions are handled in this model only
See Qt4 docs "Using Drag and Drop with Item Views" for more info.
*/
- Qt::ItemFlags flags(const QModelIndex &index) const;
- Qt::DropActions supportedDropActions() const;
- QStringList mimeTypes() const;
- QMimeData * mimeData(const QModelIndexList &indexes) const;
- bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent);
+ Qt::ItemFlags flags(const QModelIndex& index) const override;
+ Qt::DropActions supportedDropActions() const override;
+ QStringList mimeTypes() const override;
+ QMimeData* mimeData(const QModelIndexList& indexes) const override;
+ bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) override;
};
#endif
Modified: trunk/Scribus/scribus/chartableview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/chartableview.cpp
==============================================================================
--- trunk/Scribus/scribus/chartableview.cpp (original)
+++ trunk/Scribus/scribus/chartableview.cpp Mon Jun 10 15:36:31 2019
@@ -16,8 +16,7 @@
CharTableView::CharTableView(QWidget * parent)
- : QTableView(parent),
- zoom(nullptr)
+ : QTableView(parent)
{
deleteAct = new QAction( tr("Delete"), this);
connect(deleteAct, SIGNAL(triggered()), this, SLOT(removeCharacter()));
@@ -54,9 +53,9 @@
setRowHeight(model()->rowCount()-1, width() / model()->columnCount() + 5);
}
-void CharTableView::keyPressEvent(QKeyEvent *k)
+void CharTableView::keyPressEvent(QKeyEvent *event)
{
- switch (k->key())
+ switch (event->key())
{
case Qt::Key_Backspace:
case Qt::Key_Delete:
@@ -67,12 +66,12 @@
viewDoubleClicked(QModelIndex());
break;
}
- QTableView::keyPressEvent(k);
+ QTableView::keyPressEvent(event);
}
-void CharTableView::mousePressEvent(QMouseEvent* e)
+void CharTableView::mousePressEvent(QMouseEvent* event)
{
- QTableView::mousePressEvent(e);
+ QTableView::mousePressEvent(event);
int index = currentCharactersIndex();
if (index < 0)
@@ -82,38 +81,38 @@
if ((index < model()->characters().count()) && (model()->characters().count() > 0))
currentChar = model()->characters()[index];
- if (e->button() == Qt::RightButton && currentChar > -1)
+ if (event->button() == Qt::RightButton && currentChar > -1)
{
// Only non-dropable tables show "magnifier glass"
if (!acceptDrops())
{
hideZoomedChar();
zoom = new CharZoom(this, currentChar, model()->fontFace());
- zoom->move(e->globalPos().x()-2, e->globalPos().y()-2);
+ zoom->move(event->globalPos().x()-2, event->globalPos().y()-2);
zoom->show();
}
else
{
deleteAct->setData(index);
- actionMenu->popup(e->globalPos());
+ actionMenu->popup(event->globalPos());
}
}
}
-void CharTableView::mouseMoveEvent(QMouseEvent* e)
+void CharTableView::mouseMoveEvent(QMouseEvent* event)
{
// HACK to prevent strange Qt4 cursor behaviour after dropping. It's examined by Trolltech now - PV.
// It's the one and only reason why to include QApplication here.
// Fixed at least in Qt-4.4.2
// QApplication::restoreOverrideCursor();
hideZoomedChar();
- QTableView::mouseMoveEvent(e);
+ QTableView::mouseMoveEvent(event);
}
-void CharTableView::mouseReleaseEvent(QMouseEvent* e)
+void CharTableView::mouseReleaseEvent(QMouseEvent* event)
{
hideZoomedChar();
- QTableView::mouseReleaseEvent(e);
+ QTableView::mouseReleaseEvent(event);
}
void CharTableView::viewDoubleClicked(const QModelIndex & /*index*/)
@@ -133,32 +132,30 @@
void CharTableView::hideZoomedChar()
{
- if (zoom)
- {
- zoom->close();
- delete zoom;
- zoom = nullptr;
- }
+ if (!zoom)
+ return;
+ zoom->close();
+ delete zoom;
+ zoom = nullptr;
}
-void CharTableView::hideEvent(QHideEvent * e)
+void CharTableView::hideEvent(QHideEvent *event)
{
hideZoomedChar();
- QTableView::hideEvent(e);
+ QTableView::hideEvent(event);
}
void CharTableView::resizeEvent(QResizeEvent *e)
{
QTableView::resizeEvent(e);
- if (model())
- {
- model()->setViewWidth(e->size().width());
- // The resizeColumnsToContents() method won't work here.
- // It doesn't handle cells without any content. And it creates
- // larger columns than required. Dunno why.
- for (int i = 0; i < model()->columnCount(); ++i)
- setColumnWidth(i, e->size().width() / model()->columnCount());
- for (int i = 0; i < model()->rowCount(); ++i)
- setRowHeight(i, e->size().width() / model()->columnCount() + 5);
- }
+ if (!model())
+ return;
+ model()->setViewWidth(e->size().width());
+ // The resizeColumnsToContents() method won't work here.
+ // It doesn't handle cells without any content. And it creates
+ // larger columns than required. Dunno why.
+ for (int i = 0; i < model()->columnCount(); ++i)
+ setColumnWidth(i, e->size().width() / model()->columnCount());
+ for (int i = 0; i < model()->rowCount(); ++i)
+ setRowHeight(i, e->size().width() / model()->columnCount() + 5);
}
Modified: trunk/Scribus/scribus/chartableview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/chartableview.h
==============================================================================
--- trunk/Scribus/scribus/chartableview.h (original)
+++ trunk/Scribus/scribus/chartableview.h Mon Jun 10 15:36:31 2019
@@ -26,7 +26,7 @@
Q_OBJECT
public:
- CharTableView(QWidget * parent = 0);
+ CharTableView(QWidget * parent = nullptr);
signals:
void selectChar(uint, QString);
@@ -43,17 +43,17 @@
protected:
//! \brief Magnify dialog reference
- CharZoom* zoom;
+ CharZoom* zoom {nullptr};
- QAction * deleteAct;
- QMenu * actionMenu;
+ QAction* deleteAct;
+ QMenu* actionMenu;
- CharTableModel * model();
- void hideEvent(QHideEvent *);
- void keyPressEvent(QKeyEvent *k);
- void mouseReleaseEvent(QMouseEvent *m);
- void mousePressEvent(QMouseEvent* e);
- void mouseMoveEvent(QMouseEvent* e);
+ CharTableModel* model();
+ void hideEvent(QHideEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent* event) override;
+ void mouseMoveEvent(QMouseEvent* event) override;
//! \brief Map current QModelIndex into CharClassDef index/position
int currentCharactersIndex();
@@ -61,7 +61,7 @@
void hideZoomedChar();
//! \brief Used for computing the items' pixmap size in the model.
- void resizeEvent(QResizeEvent *e);
+ void resizeEvent(QResizeEvent *e) override;
private slots:
void removeCharacter();
Modified: trunk/Scribus/scribus/cmserrorhandling.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/cmserrorhandling.h
==============================================================================
--- trunk/Scribus/scribus/cmserrorhandling.h (original)
+++ trunk/Scribus/scribus/cmserrorhandling.h Mon Jun 10 15:36:31 2019
@@ -7,7 +7,7 @@
#ifndef CMSERRORHANDLING_H
#define CMSERRORHANDLING_H
-#include <setjmp.h>
+#include <csetjmp>
/*!
\brief Jump buffer used by cmsErrorHandler, must be set with the setjmp() function
Modified: trunk/Scribus/scribus/collapsedtablepainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/collapsedtablepainter.h
==============================================================================
--- trunk/Scribus/scribus/collapsedtablepainter.h (original)
+++ trunk/Scribus/scribus/collapsedtablepainter.h Mon Jun 10 15:36:31 2019
@@ -28,7 +28,7 @@
explicit CollapsedTablePainter(PageItem_Table* table) : TablePainter(table) {}
/// Paints the table using @a p and returns the table offset.
- virtual void paintTable(ScPainter* p);
+ void paintTable(ScPainter* p) override;
private:
/// Paints the fill of the table.
Modified: trunk/Scribus/scribus/collect4output.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/collect4output.h
==============================================================================
--- trunk/Scribus/scribus/collect4output.h (original)
+++ trunk/Scribus/scribus/collect4output.h Mon Jun 10 15:36:31 2019
@@ -36,12 +36,12 @@
\param compressDoc use gzipped document
*/
CollectForOutput(ScribusDoc* doc, const QString& outputDirectory=QString::null, bool withFonts=false, bool withProfiles=false, bool compressDoc=false);
- ~CollectForOutput(){};
+ ~CollectForOutput() override = default;
/*! \brief Main method doing everything.
It calls all related methods
*/
- virtual QString collect(QString &newFileName);
+ QString collect(QString &newFileName);
protected:
/*! Doc to collect */
Modified: trunk/Scribus/scribus/colormgmt/scciedata.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/colormgmt/scciedata.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/scciedata.h (original)
+++ trunk/Scribus/scribus/colormgmt/scciedata.h Mon Jun 10 15:36:31 2019
@@ -38,12 +38,12 @@
const ScCIEObserver& cieObserver(eObserver observer) const;
/**
- * @brief Retrieve data for CIE 1931 2° observer.
+ * @brief Retrieve data for CIE 1931 2° observer.
*/
const ScCIE1931Observer& cie1931Observer() const { return m_cie1931Observer; }
/**
- * @brief Retrieve data for CIE 1964 10° observer.
+ * @brief Retrieve data for CIE 1964 10° observer.
*/
const ScCIE1964Observer& cie1964Observer() const { return m_cie1964Observer; }
@@ -59,15 +59,15 @@
protected:
/** @brief Constructor. Use ScCIEData::instance() instead. */
- ScCIEData() {}
+ ScCIEData() = default;
/** @brief Pointer to existing instance of ScCIEData, if any. */
static ScCIEData* m_instance;
- /** @brief CIE 1931 2° observer. */
+ /** @brief CIE 1931 2° observer. */
ScCIE1931Observer m_cie1931Observer;
- /** @brief CIE 1964 10° observer. */
+ /** @brief CIE 1964 10° observer. */
ScCIE1964Observer m_cie1964Observer;
/** @brief CIE D50 illuminant. */
@@ -77,4 +77,4 @@
ScD65Illuminant m_d65Illuminant;
};
-#endif
+#endif
Modified: trunk/Scribus/scribus/colormgmt/sccieilluminants.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/colormgmt/sccieilluminants.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccieilluminants.h (original)
+++ trunk/Scribus/scribus/colormgmt/sccieilluminants.h Mon Jun 10 15:36:31 2019
@@ -14,7 +14,7 @@
class ScCIEIlluminant
{
public:
- virtual ~ScCIEIlluminant() {}
+ ~ScCIEIlluminant() = default;
// Relative illuminant power for specified wavelength
double power(int waveLen) const { return m_pow.value(waveLen, 0.0); }
@@ -29,14 +29,14 @@
class ScD50Illuminant : public ScCIEIlluminant
{
-public:
- ScD50Illuminant();
+ public:
+ ScD50Illuminant();
};
class ScD65Illuminant : public ScCIEIlluminant
{
-public:
- ScD65Illuminant();
+ public:
+ ScD65Illuminant();
};
-#endif // SCCIEILLUMINANTS_H
+#endif // SCCIEILLUMINANTS_H
Modified: trunk/Scribus/scribus/colormgmt/sccieobservers.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/colormgmt/sccieobservers.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccieobservers.h (original)
+++ trunk/Scribus/scribus/colormgmt/sccieobservers.h Mon Jun 10 15:36:31 2019
@@ -14,7 +14,7 @@
class ScCIEObserver
{
public:
- virtual ~ScCIEObserver() {}
+ ~ScCIEObserver() = default;
// Wavelengths represented in the data set
QVector<int> wavelengths() const;
@@ -36,14 +36,14 @@
class ScCIE1931Observer : public ScCIEObserver
{
-public:
- ScCIE1931Observer();
+ public:
+ ScCIE1931Observer();
};
class ScCIE1964Observer : public ScCIEObserver
{
-public:
- ScCIE1964Observer();
+ public:
+ ScCIE1964Observer();
};
#endif // SCCIEOBSERVERS_H
Modified: trunk/Scribus/scribus/colormgmt/sccolormgmtelem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/colormgmt/sccolormgmtelem.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolormgmtelem.h (original)
+++ trunk/Scribus/scribus/colormgmt/sccolormgmtelem.h Mon Jun 10 15:36:31 2019
@@ -13,7 +13,7 @@
class ScColorMgmtElem
{
public:
- virtual ~ScColorMgmtElem() {};
+ virtual ~ScColorMgmtElem() = default;
virtual ScColorMgmtEngine& engine() = 0;
virtual const ScColorMgmtEngine& engine() const = 0;
};
Modified: trunk/Scribus/scribus/colormgmt/sccolorspace.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/colormgmt/sccolorspace.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolorspace.h (original)
+++ trunk/Scribus/scribus/colormgmt/sccolorspace.h Mon Jun 10 15:36:31 2019
@@ -56,10 +56,10 @@
eRenderIntent proofingIntent, long transformFlags);
// Convert color data to a specific color space
+ bool convert(ScColorSpace& data, eRenderIntent renderIntent, long transformFlags,
+ void* dataIn, void* dataOut, uint numElems, ScColorTransform* lastTrans = nullptr);
bool convert(ScColorSpace& data, eRenderIntent renderIntent, long transformFlags,
- void* dataIn, void* dataOut, uint numElems, ScColorTransform* lastTrans = 0);
- bool convert(ScColorSpace& data, eRenderIntent renderIntent, long transformFlags,
- void* dataIn, QIODevice* device, uint numElems, ScColorTransform* lastTrans = 0);
+ void* dataIn, QIODevice* device, uint numElems, ScColorTransform* lastTrans = nullptr);
const ScColorSpaceData* data() const { return m_data.data(); }
Modified: trunk/Scribus/scribus/colorsetmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/colorsetmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.cpp (original)
+++ trunk/Scribus/scribus/colorsetmanager.cpp Mon Jun 10 15:36:31 2019
@@ -27,13 +27,9 @@
#include <QByteArray>
#include <QDebug>
-ColorSetManager::ColorSetManager()
-{
-}
-
-ColorSetManager::~ColorSetManager()
-{
-}
+ColorSetManager::ColorSetManager() = default;
+
+ColorSetManager::~ColorSetManager() = default;
void ColorSetManager::initialiseDefaultPrefs(struct ApplicationPrefs& appPrefs)
{
Modified: trunk/Scribus/scribus/desaxe/actions.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/desaxe/actions.h
==============================================================================
--- trunk/Scribus/scribus/desaxe/actions.h (original)
+++ trunk/Scribus/scribus/desaxe/actions.h Mon Jun 10 15:36:31 2019
@@ -28,15 +28,14 @@
class Action_body
{
protected:
- Action_body() : dig(NULL) {}
- virtual ~Action_body() {}
- virtual void begin(const Xml_string&, Xml_attr) {}
-
- virtual void end(const Xml_string&) {}
- virtual void chars(const Xml_string&) {}
- virtual void reset() {}
+ Action_body() {}
+ virtual ~Action_body() {}
+ virtual void begin(const Xml_string&, Xml_attr) {}
+ virtual void end(const Xml_string&) {}
+ virtual void chars(const Xml_string&) {}
+ virtual void reset() {}
- Digester* dig;
+ Digester* dig {nullptr};
private:
int refs;
friend class Action;
Modified: trunk/Scribus/scribus/exif.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/exif.h
==============================================================================
--- trunk/Scribus/scribus/exif.h (original)
+++ trunk/Scribus/scribus/exif.h Mon Jun 10 15:36:31 2019
@@ -11,20 +11,21 @@
exif.h
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <time.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cmath>
+#include <ctime>
-#include "qstring.h"
-#include "qfile.h"
-#include "qimage.h"
+#include <QString>
+#include <QFile>
+#include <QImage>
-typedef enum {
- READ_EXIF = 1,
- READ_IMAGE = 2,
- READ_ALL = 3
-}ReadMode_t;
+typedef enum
+{
+ READ_EXIF = 1,
+ READ_IMAGE = 2,
+ READ_ALL = 3
+} ReadMode_t;
//--------------------------------------------------------------------------
// This structure is used to store jpeg file sections in memory.
@@ -42,7 +43,7 @@
class TagTable
{
public:
- TagTable ( unsigned short t, const char* d ) : Tag ( t ), Desc ( d ) {}
+ TagTable(unsigned short t, const char* d) : Tag (t), Desc (d) {}
unsigned short Tag;
const char*const Desc;
};
@@ -52,28 +53,29 @@
class ExifData
{
-// Section_t Sections[MAX_SECTIONS];
+// Section_t Sections[MAX_SECTIONS];
QString CameraMake;
QString CameraModel;
QString DateTime;
- int Orientation;
+ int Orientation;
int orientationCount;
- int Height, Width;
- int ExifImageLength, ExifImageWidth;
- int IsColor;
- int Process;
- int FlashUsed;
+ int Height, Width;
+ int ExifImageLength;
+ int ExifImageWidth;
+ int IsColor;
+ int Process;
+ int FlashUsed;
float FocalLength;
float ExposureTime;
float ApertureFNumber;
float Distance;
- int Whitebalance;
- int MeteringMode;
+ int Whitebalance;
+ int MeteringMode;
float CCDWidth;
float ExposureBias;
- int ExposureProgram;
- int ISOequivalent;
- int CompressionLevel;
+ int ExposureProgram;
+ int ISOequivalent;
+ int CompressionLevel;
QString UserComment;
QString Comment;
int recurseLevel;
Modified: trunk/Scribus/scribus/fileloader.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/fileloader.h
==============================================================================
--- trunk/Scribus/scribus/fileloader.h (original)
+++ trunk/Scribus/scribus/fileloader.h Mon Jun 10 15:36:31 2019
@@ -32,10 +32,10 @@
Q_OBJECT
public:
FileLoader(const QString & fileName);
- ~FileLoader() {}
+ ~FileLoader() override = default;
- int fileType() const { return m_fileType; }
- int testFile();
+ int fileType() const { return m_fileType; }
+ int testFile();
bool loadPage(ScribusDoc* currDoc, int PageToLoad, bool Mpage, const QString& renamedPageName=QString::null);
bool loadFile(ScribusDoc* currDoc);
@@ -63,7 +63,7 @@
PrefsManager* m_prefsManager;
QString m_fileName;
- int m_fileType;
+ int m_fileType;
};
#endif
Modified: trunk/Scribus/scribus/filewatcher.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/filewatcher.cpp
==============================================================================
--- trunk/Scribus/scribus/filewatcher.cpp (original)
+++ trunk/Scribus/scribus/filewatcher.cpp Mon Jun 10 15:36:31 2019
@@ -40,7 +40,7 @@
delete m_watchTimer;
}
-void FileWatcher::setTimeOut(const int newTimeOut, const bool restartTimer)
+void FileWatcher::setTimeOut(int newTimeOut, bool restartTimer)
{
m_timeOut=newTimeOut;
if (restartTimer)
Modified: trunk/Scribus/scribus/filewatcher.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/filewatcher.h
==============================================================================
--- trunk/Scribus/scribus/filewatcher.h (original)
+++ trunk/Scribus/scribus/filewatcher.h Mon Jun 10 15:36:31 2019
@@ -23,7 +23,7 @@
public:
FileWatcher(QObject* parent);
- ~FileWatcher();
+ ~FileWatcher() override;
bool isActive();
// Get if file check loop is running
void isFileCheckRunning();
@@ -54,12 +54,12 @@
{
QFileInfo info;
QDateTime timeInfo;
- int pendingCount;
- bool pending;
- int refCount;
- bool isDir;
- bool fast;
- ScribusDoc* doc; //CB Added as part of #9845 but unused for now, we could avoid scanning docs in updatePict() if we used this
+ int pendingCount {};
+ bool pending {};
+ int refCount {};
+ bool isDir {};
+ bool fast {};
+ ScribusDoc* doc{}; //CB Added as part of #9845 but unused for now, we could avoid scanning docs in updatePict() if we used this
};
Modified: trunk/Scribus/scribus/fonts/scface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/fonts/scface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.h (original)
+++ trunk/Scribus/scribus/fonts/scface.h Mon Jun 10 15:36:31 2019
@@ -198,7 +198,7 @@
virtual GlyphMetrics glyphBBox(gid_type gl, qreal sz) const;
virtual bool embedFont(QByteArray &/*str*/) const { return false; }
virtual void rawData(QByteArray & /*bb*/) const {}
- virtual FT_Face ftFace() const { return 0; }
+ virtual FT_Face ftFace() const { return nullptr; }
virtual void* hbFont();
virtual bool isItalic() const { return false; }
@@ -265,7 +265,7 @@
bool isReplacement() const { return !m_replacedName.isEmpty(); }
/// makes a repalcement font for font "name" using this fonts data
- ScFace mkReplacementFor(QString name, QString doc) {
+ ScFace mkReplacementFor(const QString& name, const QString& doc) {
ScFace result(m_m);
result.m_replacedName = name;
result.m_replacedInDoc = doc;
Modified: trunk/Scribus/scribus/fpoint.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/fpoint.cpp
==============================================================================
--- trunk/Scribus/scribus/fpoint.cpp (original)
+++ trunk/Scribus/scribus/fpoint.cpp Mon Jun 10 15:36:31 2019
@@ -26,7 +26,7 @@
#include <QTransform>
//Create transformed point
-FPoint::FPoint(const double x, const double y, const double dx, const double dy, const double rot, const double sx, const double sy, const bool invert)
+FPoint::FPoint(double x, double y, double dx, double dy, double rot, double sx, double sy, bool invert)
: xp(x), yp(y)
{
transform(dx,dy,rot,sx,sy,invert);
Modified: trunk/Scribus/scribus/fpoint.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/fpoint.h
==============================================================================
--- trunk/Scribus/scribus/fpoint.h (original)
+++ trunk/Scribus/scribus/fpoint.h Mon Jun 10 15:36:31 2019
@@ -49,7 +49,7 @@
FPoint(const QPointF & p) : xp(p.x()), yp(p.y()) {}
FPoint(const FPoint & p) : xp(p.xp), yp(p.yp) {}
//Creates a transformed point, replaces ScribusView::transformPoint()
- FPoint(const double x, const double y, const double dx, const double dy, const double rot, const double sx, const double sy, const bool invert=false);
+ FPoint(double x, double y, double dx, double dy, double rot, double sx, double sy, bool invert=false);
// ~FPoint() {};
FPoint& operator=(const FPoint & rhs);
double x() const;
@@ -67,10 +67,10 @@
friend inline const FPoint operator*( const double &, const FPoint & );
friend inline double operator*( const FPoint &a, const FPoint &b );
//Transform an existing point
- void transform(const double dx, const double dy, const double rot, const double sx, const double sy, const bool invert);
+ void transform(double dx, double dy, double rot, double sx, double sy, bool invert);
//Transform an existing point, return a new one
FPoint transformPoint(const QTransform& m, const bool invert) const;
- FPoint transformPoint(const double dx, const double dy, const double rot, const double sx, const double sy, const bool invert) const;
+ FPoint transformPoint(double dx, double dy, double rot, double sx, double sy, bool invert) const;
/// Returns a copy of the point as a QPointF.
QPointF toQPointF() const { return QPointF(xp, yp); }
friend class FPointArray;
Modified: trunk/Scribus/scribus/fpointarray.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/fpointarray.h
==============================================================================
--- trunk/Scribus/scribus/fpointarray.h (original)
+++ trunk/Scribus/scribus/fpointarray.h Mon Jun 10 15:36:31 2019
@@ -41,18 +41,18 @@
class SCRIBUS_API FPointArray : public QVector<FPoint>
{
-public:
- FPointArray() : m_svgState(NULL) {};
- FPointArray(int size) : QVector<FPoint>(size), m_svgState(NULL) {};
- FPointArray(const FPointArray &a) : QVector<FPoint>(a), m_svgState(NULL) {};
+public:
+ FPointArray() : m_svgState(nullptr) {};
+ FPointArray(int size) : QVector<FPoint>(size), m_svgState(nullptr) {};
+ FPointArray(const FPointArray &a) : QVector<FPoint>(a), m_svgState(nullptr) {};
int size() const { return QVector<FPoint>::count(); }
bool resize(int newCount);
void reverse();
void setPoint(int i, double x, double y) { FPoint& p = QVector<FPoint>::operator[](i); p.xp = x; p.yp = y; };
void setPoint(int i, FPoint p) { setPoint(i, p.xp, p.yp); }
- bool setPoints( int nPoints, double firstx, double firsty, ... );
- bool putPoints( int index, int nPoints, double firstx, double firsty, ... );
- bool putPoints( int index, int nPoints, const FPointArray & from, int fromIndex = 0 );
+ bool setPoints(int nPoints, double firstx, double firsty, ... );
+ bool putPoints(int index, int nPoints, double firstx, double firsty, ... );
+ bool putPoints(int index, int nPoints, const FPointArray & from, int fromIndex = 0 );
void point(int i, double *x, double *y) const;
const FPoint& point(int i) const{ return QVector<FPoint>::at(i); }
QPoint pointQ(int i) const;
Modified: trunk/Scribus/scribus/hyphenator.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/hyphenator.h
==============================================================================
--- trunk/Scribus/scribus/hyphenator.h (original)
+++ trunk/Scribus/scribus/hyphenator.h Mon Jun 10 15:36:31 2019
@@ -42,7 +42,7 @@
\date
\author Franz Schmid
*/
- ~Hyphenator();
+ ~Hyphenator() override;
private:
Modified: trunk/Scribus/scribus/loadsaveplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/loadsaveplugin.h
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.h (original)
+++ trunk/Scribus/scribus/loadsaveplugin.h Mon Jun 10 15:36:31 2019
@@ -100,12 +100,12 @@
// file type (eg "XML doc with root element SCRIBUSXML and version 1.3.1").
// All plugins must implement this method.
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString::null) const = 0;
-
+
// Return a list of all formats supported by all currently loaded and
// active plugins. This list is sorted in a very specific order:
// First, by descending order of `id', then descending order of priority.
static const QList<FileFormat> & supportedFormats();
-
+
virtual void setupTargets(ScribusDoc *targetDoc, ScribusView* targetView, ScribusMainWindow* targetMW, QProgressBar* targetMWPRogressBar, SCFonts* targetAvailableFonts);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString::null);
@@ -115,7 +115,7 @@
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual QImage readThumbnail(const QString& fileName);
-
+
protected:
/// Check a loadFlags combination
@@ -135,7 +135,7 @@
// Set standard message for dom style errors with line and column
virtual void setDomParsingError(const QString& msg, int line, int column);
-
+
ScribusDoc* m_Doc;
ScribusView* m_View; //For 1.2.x loader at the moment
ScribusMainWindow* m_ScMW; //For plugins when required
@@ -163,7 +163,7 @@
static QList<FileFormat>::iterator findFormat(unsigned int id,
LoadSavePlugin* plug = 0,
QList<FileFormat>::iterator it = formats.begin());
-
+
static QList<FileFormat>::iterator findFormat(const QString& extension,
LoadSavePlugin* plug = 0,
QList<FileFormat>::iterator it = formats.begin());
@@ -205,7 +205,7 @@
QString saveElements(double xp, double yp, double wp, double hp, Selection* selection, QByteArray &prevData) const;
// Get last saved file
QString lastSavedFile() const;
-
+
void setupTargets(ScribusDoc *targetDoc, ScribusView* targetView, ScribusMainWindow* targetMW, QProgressBar* targetMWPRogressBar, SCFonts* targetAvailableFonts) const;
void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces) const;
bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString::null) const;
Modified: trunk/Scribus/scribus/margins.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/margins.h
==============================================================================
--- trunk/Scribus/scribus/margins.h (original)
+++ trunk/Scribus/scribus/margins.h Mon Jun 10 15:36:31 2019
@@ -25,7 +25,7 @@
class MarginStruct
{
public:
- MarginStruct() : m_top(0), m_left(0), m_bottom(0), m_right(0) {}
+ MarginStruct() {}
MarginStruct(double top, double left, double bottom, double right) :
m_top(top), m_left(left), m_bottom(bottom), m_right(right) {}
//unneeded? default compiler generated should suffice
@@ -48,10 +48,10 @@
protected:
- double m_top;
- double m_left;
- double m_bottom;
- double m_right;
+ double m_top {0.0};
+ double m_left {0.0};
+ double m_bottom {0.0};
+ double m_right {0.0};
};
#if QT_VERSION >= 0x050300
Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp (original)
+++ trunk/Scribus/scribus/menumanager.cpp Mon Jun 10 15:36:31 2019
@@ -84,7 +84,7 @@
return nullptr;
}
-void MenuManager::setMenuEnabled(const QString &menuName, const bool enabled)
+void MenuManager::setMenuEnabled(const QString &menuName, bool enabled)
{
// OSX UI rules don't allow this so let's not do it elsewhere.
//if (menuBarMenus.contains(menuName) && menuBarMenus.value(menuName)!=nullptr)
@@ -119,7 +119,7 @@
}
if (beforeAct)
{
- QMenu *m=new QMenu(menuName);
+ auto *m=new QMenu(menuName);
scribusMenuBar->insertMenu(beforeAct, m);
menuBarMenus.insert(menuName, m);
retVal=true;
@@ -258,7 +258,7 @@
return retVal;
}
-void MenuManager::runMenuAtPos(const QString &menuName, const QPoint position)
+void MenuManager::runMenuAtPos(const QString &menuName, const QPoint& position)
{
/*
if (menuList.contains(menuName) && menuList[menuName]!=nullptr)
Modified: trunk/Scribus/scribus/menumanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/menumanager.h
==============================================================================
--- trunk/Scribus/scribus/menumanager.h (original)
+++ trunk/Scribus/scribus/menumanager.h Mon Jun 10 15:36:31 2019
@@ -52,8 +52,8 @@
bool createMenu(const QString &menuName, const QString &menuText = QString::null, const QString& parent = QString::null, bool checkable = false, bool rememberMenu = false);
void removeMenuItem(const QString& s, ScrAction *menuAction, const QString &parent);
bool removeMenuItem(ScrAction *menuAction, const QString &parent);
- void runMenuAtPos(const QString &, const QPoint);
- void setMenuEnabled(const QString &menuName, const bool enabled);
+ void runMenuAtPos(const QString &, const QPoint&);
+ void setMenuEnabled(const QString &menuName, bool enabled);
void setText(const QString &menuName, const QString &menuText);
QMenu *getLocalPopupMenu(const QString &menuName);
Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Mon Jun 10 15:36:31 2019
@@ -350,8 +350,8 @@
int level() const; ///< Get item level relative to its parent doc or group
- void saxx(SaxHandler& handler, const Xml_string& elemtag) const {}
- void saxx(SaxHandler& handler) const {}
+ void saxx(SaxHandler& handler, const Xml_string& elemtag) const override {}
+ void saxx(SaxHandler& handler) const override {}
/**
@@ -487,43 +487,43 @@
double visualXPos() const;
double visualYPos() const;
FPoint xyPos() const { return FPoint(m_xPos, m_yPos); }
- void setXPos(const double, bool drawingOnly=false);
- void setYPos(const double, bool drawingOnly=false);
- void setXYPos(const double, const double, bool drawingOnly=false);
- void moveBy(const double, const double, bool drawingOnly=false);
+ void setXPos(double, bool drawingOnly=false);
+ void setYPos(double, bool drawingOnly=false);
+ void setXYPos(double, double, bool drawingOnly=false);
+ void moveBy(double, double, bool drawingOnly=false);
//Size
- double width() const { return m_width; }
- double height() const { return m_height; }
+ double width() const override { return m_width; }
+ double height() const override { return m_height; }
double visualWidth() const;
double visualHeight() const;
double visualLineWidth() const;
void setWidth(const double);
void setHeight(const double);
- void setWidthHeight(const double, const double, bool drawingOnly);
- void setWidthHeight(const double, const double);
- void resizeBy(const double, const double);
+ void setWidthHeight(double, double, bool drawingOnly);
+ void setWidthHeight(double, double);
+ void resizeBy(const double, double);
//Rotation
double rotation() const { return m_rotation; }
- void setRotation(const double, bool drawingOnly);
- void setRotation(const double r) { setRotation(r, false); } ///< needed for deSaXe
- void rotateBy(const double);
+ void setRotation(double, bool drawingOnly);
+ void setRotation(double r) { setRotation(r, false); } ///< needed for deSaXe
+ void rotateBy(double);
//Selection
bool isSelected() const { return m_isSelected; }
- void setSelected(const bool);
+ void setSelected(bool);
//Image Data
double imageXScale() const { return m_imageXScale; }
double imageYScale() const { return m_imageYScale; }
- void setImageXScale(const double);
- void setImageYScale(const double);
- void setImageXYScale(const double, const double);
+ void setImageXScale(double);
+ void setImageYScale(double);
+ void setImageXYScale(double, double);
double imageXOffset() const { return m_imageXOffset; }
double imageYOffset() const { return m_imageYOffset; }
- void setImageXOffset(const double);
- void setImageYOffset(const double);
- void moveImageXYOffsetBy(const double, const double);
- void setImageXYOffset(const double, const double);
+ void setImageXOffset(double);
+ void setImageYOffset(double);
+ void moveImageXYOffsetBy(double, double);
+ void setImageXYOffset(double, double);
double imageRotation() const { return m_imageRotation; }
- void setImageRotation(const double newRotation);
+ void setImageRotation(double newRotation);
//Rounded Corners
double cornerRadius() const { return m_roundedCorderRadius; }
void setCornerRadius(double);
@@ -1145,7 +1145,7 @@
void changeImageScaleUndoAction();
/*@}*/
/** @brief Required by the UndoObject */
- void restore(UndoState *state, bool isUndo);
+ void restore(UndoState *state, bool isUndo) override;
virtual void getNamedResources(ResourceCollection& lists) const;
virtual void replaceNamedResources(ResourceCollection& newNames);
@@ -1191,7 +1191,7 @@
* @brief Load an image into an image frame, moved from ScribusView
* @return True if load succeeded
*/
- virtual bool loadImage(const QString& filename, const bool reload, const int gsResolution=-1, bool showMsg = false);
+ virtual bool loadImage(const QString& filename, bool reload, int gsResolution=-1, bool showMsg = false);
/**
Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp (original)
+++ trunk/Scribus/scribus/scfonts.cpp Mon Jun 10 15:36:31 2019
@@ -933,7 +933,7 @@
}
else
replFont = prefsManager->appPrefs.fontPrefs.GFontSub[fontname];
- ScFace repl = (*this)[replFont].mkReplacementFor(fontname, doc ? doc->documentFileName() : QString(""));
+ ScFace repl = (*this)[replFont].mkReplacementFor(fontname, doc ? doc->documentFileName() : QString());
insert(fontname, repl);
}
else if ( doc && !doc->UsedFonts.contains(fontname) )
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Jun 10 15:36:31 2019
@@ -6043,7 +6043,7 @@
if (doc)
view->requestMode(modeNormal);
else
- appModeHelper->resetApplicationMode(this, modeNormal);
+ appModeHelper->resetApplicationMode(modeNormal);
}
void ScribusMainWindow::setAppModeByToggle(bool isOn, int newMode)
Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp (original)
+++ trunk/Scribus/scribus/scribuscore.cpp Mon Jun 10 15:36:31 2019
@@ -109,13 +109,13 @@
int ScribusCore::startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString& newGuiLanguage)
{
- ScribusMainWindow* scribus = new ScribusMainWindow();
+ auto* scribus = new ScribusMainWindow();
Q_CHECK_PTR(scribus);
if (!scribus)
return(EXIT_FAILURE);
m_ScMWList.append(scribus);
m_currScMW=0;
- int retVal=initScribusCore(showSplash, showFontInfo, showProfileInfo,newGuiLanguage);
+ int retVal=initScribusCore(showSplash, showFontInfo, showProfileInfo, newGuiLanguage);
if (retVal == EXIT_FAILURE)
return(EXIT_FAILURE);
@@ -160,7 +160,7 @@
return EXIT_SUCCESS;
}
-int ScribusCore::initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage)
+int ScribusCore::initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString& newGuiLanguage)
{
CommonStrings::languageChange();
LanguageManager::instance()->languageChange();
Modified: trunk/Scribus/scribus/scribuscore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/scribuscore.h
==============================================================================
--- trunk/Scribus/scribus/scribuscore.h (original)
+++ trunk/Scribus/scribus/scribuscore.h Mon Jun 10 15:36:31 2019
@@ -55,7 +55,7 @@
public:
ScribusCore();
- ~ScribusCore();
+ ~ScribusCore() override;
ScSplashScreen* splash() {return m_SplashScreen;}
/*
@@ -65,7 +65,7 @@
int runScript() {return 0;}
*/
int init(bool useGUI, const QList<QString>& filesToUse);
- int initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage);
+ int initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString& newGuiLanguage);
bool initialized() const {return m_ScribusInitialized;}
const QString& getGuiLanguage() const;
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Mon Jun 10 15:36:31 2019
@@ -100,7 +100,7 @@
bool inASpecialEditMode() const;
QList<PageItem*> getAllItems(QList<PageItem*> &items);
QList<PageItem*> *parentGroup(PageItem* item, QList<PageItem*> *list);
- void setup(const int, const int, const int, const int, const int, const QString&, const QString&);
+ void setup(int, int, int, int, int, const QString&, const QString&);
void setLoading(const bool);
bool isLoading() const;
void setModified(const bool);
@@ -163,7 +163,7 @@
void setAutoSaveCount(int i) { m_docPrefsData.docSetupPrefs.AutoSaveCount=i; }
void setAutoSaveKeep(bool i) { m_docPrefsData.docSetupPrefs.AutoSaveKeep=i; }
void setAutoSaveInDocDir(bool i) { m_docPrefsData.docSetupPrefs.AutoSaveLocation=i; }
- void setAutoSaveDir(QString i) { m_docPrefsData.docSetupPrefs.AutoSaveDir = i; }
+ void setAutoSaveDir(const QString& autoDaveDir) { m_docPrefsData.docSetupPrefs.AutoSaveDir = autoDaveDir; }
//FIXME (maybe) :non const, the loaders make a mess here
PDFOptions& pdfOptions() { return m_docPrefsData.pdfPrefs; }
ObjAttrVector& itemAttributes() { return m_docPrefsData.itemAttrPrefs.defaultItemAttributes; }
@@ -217,11 +217,11 @@
// Add, delete and move pages
- ScPage* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
- void deletePage(const int);
+ ScPage* addPage(int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
+ void deletePage(int);
//! @brief Add a master page with this function, do not use addPage
- ScPage* addMasterPage(const int, const QString&);
- void deleteMasterPage(const int);
+ ScPage* addMasterPage(int, const QString&);
+ void deleteMasterPage(int);
//! @brief Rebuild master name list
void rebuildMasterNames();
//! @brief Replace a master page by default one
Modified: trunk/Scribus/scribus/ui/scmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/scmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/scmenu.cpp Mon Jun 10 15:36:31 2019
@@ -5,9 +5,9 @@
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
- begin : Jan 2005
- copyright : (C) 2005 by Craig Bradney
- email : cbradney at zip.com.au
+ begin : Jan 2005
+ copyright : (C) 2005 by Craig Bradney
+ email : cbradney at zip.com.au
***************************************************************************/
/***************************************************************************
@@ -84,7 +84,7 @@
// {
// menuBarID=id;
// }
-//
+//
// int ScrPopupMenu::getMenuBarID()
// {
// return menuBarID;
@@ -104,8 +104,8 @@
// {
// parentMenuID=id;
// }
-//
-//
+//
+//
// const int ScrPopupMenu::getParentMenuID()
// {
// return parentMenuID;
@@ -184,7 +184,7 @@
localPopupMenu->insertItem(widget);
return true;
}
- else
+ else
return false;
}
*/
@@ -194,13 +194,13 @@
//Allow duplicate menu items ???
//if (menuItemList.findRef(newMenuAction)!=-1)
// return false;
-
+
#ifdef Q_OS_MAC
if (newMenuAction && afterMenuAction)
if (newMenuAction->icon().isNull() && ! (afterMenuAction->icon().isNull()))
newMenuAction->setIcon(IconManager::instance()->loadIcon("noicon.png"));
#endif
-
+
int pos=menuItemList.indexOf(QPointer<QObject>(afterMenuAction));
menuItemList.insert(++pos, QPointer<QObject>(newMenuAction));
/*
@@ -231,7 +231,7 @@
bool found=false;
QPtrListIterator<QObject> menuItemListIt(menuItemList);
QObject *object;
- while ( (object = menuItemListIt.current()) != 0 )
+ while ( (object = menuItemListIt.current()) != 0 )
{
QString menuItemListClassName=object->className();
int index=-1;
@@ -249,12 +249,12 @@
else
{
//Grab the action from the list, break and call the other after insert function
-
+
int newIndex=++index;
bool insSuccess=menuItemList.insert(newIndex, newMenuAction);
if (!insSuccess)
return false;
-
+
}
}
}
@@ -262,7 +262,7 @@
return false;
if (retVal==false)
return false;
-
+
return repopulateLocalMenu();
}
*/
@@ -290,7 +290,7 @@
if (act!=nullptr)
localPopupMenu->addAction(act);
}
- else
+ else
{
if (menuItemListClassName=="ScrPopupMenu")
{
@@ -325,25 +325,25 @@
menuItemList.removeAll(*menuItemListItToDelete);
continue;
}
-
+
QString menuItemListClassName=listObj->metaObject()->className();
if (menuItemListClassName=="ScrAction")
{
- ScrAction *sca=dynamic_cast<ScrAction *>(listObj);
+ auto *sca=dynamic_cast<ScrAction *>(listObj);
if (sca!=nullptr)
actNames->append(sca->objectName());
}
else
if (menuItemListClassName=="ScrPopupMenu")
{
- ScrPopupMenu *scp=dynamic_cast<ScrPopupMenu *>(listObj);
+ auto *scp=dynamic_cast<ScrPopupMenu *>(listObj);
if (scp!=nullptr)
scp->generateEntryList(actNames);
}
++menuItemListIt;
}
return true;
-
+
}
bool ScrPopupMenu::clear()
Modified: trunk/Scribus/scribus/ui/scmenu.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/scmenu.h
==============================================================================
--- trunk/Scribus/scribus/ui/scmenu.h (original)
+++ trunk/Scribus/scribus/ui/scmenu.h Mon Jun 10 15:36:31 2019
@@ -36,7 +36,7 @@
{
Q_OBJECT
public:
- ScrPopupMenu ( QWidget * parent = 0, const QString& pMenuName = QString::null, const QString& pMenuText = QString::null, const QString& parentName = QString::null, bool checkable = false);
+ ScrPopupMenu ( QWidget * parent = nullptr, const QString& pMenuName = QString::null, const QString& pMenuText = QString::null, const QString& parentName = QString::null, bool checkable = false);
~ScrPopupMenu ();
const QString getMenuName();
Modified: trunk/Scribus/scribus/ui/scmessagebox.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/scmessagebox.h
==============================================================================
--- trunk/Scribus/scribus/ui/scmessagebox.h (original)
+++ trunk/Scribus/scribus/ui/scmessagebox.h Mon Jun 10 15:36:31 2019
@@ -44,9 +44,9 @@
public:
// Property-based API
- ScMessageBox(QWidget *parent = 0);
+ ScMessageBox(QWidget *parent = nullptr);
ScMessageBox(QMessageBox::Icon icon, const QString &title, const QString &text,
- QMessageBox::StandardButtons buttons = QMessageBox::NoButton, QWidget *parent = 0,
+ QMessageBox::StandardButtons buttons = QMessageBox::NoButton, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
int exec();
QAbstractButton *clickedButton() const;
Modified: trunk/Scribus/scribus/ui/scmwmenumanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/scmwmenumanager.h
==============================================================================
--- trunk/Scribus/scribus/ui/scmwmenumanager.h (original)
+++ trunk/Scribus/scribus/ui/scmwmenumanager.h Mon Jun 10 15:36:31 2019
@@ -32,7 +32,7 @@
{
Q_OBJECT
public:
- ScMWMenuManager(QMenuBar* mb, QObject *parent=0);
+ ScMWMenuManager(QMenuBar* mb, QObject *parent=nullptr);
public slots:
void languageChange();
Modified: trunk/Scribus/scribus/ui/scrpalettebase.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/scrpalettebase.h
==============================================================================
--- trunk/Scribus/scribus/ui/scrpalettebase.h (original)
+++ trunk/Scribus/scribus/ui/scrpalettebase.h Mon Jun 10 15:36:31 2019
@@ -40,7 +40,7 @@
Q_OBJECT
public:
- ScrPaletteBase( QWidget * parent = nullptr, const QString& prefsContext = QString::null, bool modal = false, Qt::WindowFlags f = 0 );
+ ScrPaletteBase( QWidget * parent = nullptr, const QString& prefsContext = QString::null, bool modal = false, Qt::WindowFlags f = nullptr);
~ScrPaletteBase() {}
/** @brief Sample way to grab keystrokes, simply calls superclass at this point */
//virtual void keyPressEvent(QKeyEvent *keyEvent);
Modified: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp (original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp Mon Jun 10 15:36:31 2019
@@ -308,9 +308,9 @@
//If read only don't spin
if (isReadOnly())
return false;
- QWheelEvent* k = (QWheelEvent*)event;
- bool shiftB = k->modifiers() & Qt::ShiftModifier;
- bool altB = k->modifiers() & Qt::AltModifier;
+ auto* wheelEvent = dynamic_cast<QWheelEvent*>(event);
+ bool shiftB = wheelEvent->modifiers() & Qt::ShiftModifier;
+ bool altB = wheelEvent->modifiers() & Qt::AltModifier;
if (shiftB && !altB)
{
setSingleStep(0.1);
Modified: trunk/Scribus/scribus/ui/scrspinbox.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/scrspinbox.h
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.h (original)
+++ trunk/Scribus/scribus/ui/scrspinbox.h Mon Jun 10 15:36:31 2019
@@ -24,13 +24,13 @@
public:
ScrSpinBox(QWidget *parent, int unitIndex=0);
ScrSpinBox(double minValue, double maxValue, QWidget *pa, int unitIndex=0);
- ~ScrSpinBox();
+ ~ScrSpinBox() override;
//overridden members
- double valueFromText ( const QString & text ) const;
- QString textFromValue ( double value ) const;
- QValidator::State validate ( QString & input, int & pos ) const;
- void fixup ( QString & input ) const;
+ double valueFromText ( const QString & text ) const override;
+ QString textFromValue ( double value ) const override;
+ QValidator::State validate ( QString & input, int & pos ) const override;
+ void fixup ( QString & input ) const override;
// call QDoubleSpinBox::setValue() without emitting valueChanged() signal
void showValue(double val);
@@ -41,7 +41,7 @@
void setNewUnit(int unitIndex);
double getValue(int unitIndex=0) const;
- uint unitIndex() const { return m_unitIndex; }
+ uint unitIndex() const { return m_unitIndex; }
double unitRatio() const;
// Reimplement QDoubleSpinBox::stepBy() for angle wrapping
@@ -58,7 +58,7 @@
const QMap<QString, double>* m_constants;
void setParameters(int s);
- bool eventFilter ( QObject * watched, QEvent * event );
+ bool eventFilter ( QObject * watched, QEvent * event ) override;
protected slots:
void textChanged();
Modified: trunk/Scribus/scribus/ui/sctextbrowser.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/ui/sctextbrowser.h
==============================================================================
--- trunk/Scribus/scribus/ui/sctextbrowser.h (original)
+++ trunk/Scribus/scribus/ui/sctextbrowser.h Mon Jun 10 15:36:31 2019
@@ -21,7 +21,7 @@
QUrl homeUrl;
public:
- ScTextBrowser( QWidget * parent = 0 );
+ ScTextBrowser( QWidget * parent = nullptr );
void clear();
void find(const QString& txt, const int& options = 0);
Modified: trunk/Scribus/scribus/undomanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/undomanager.h
==============================================================================
--- trunk/Scribus/scribus/undomanager.h (original)
+++ trunk/Scribus/scribus/undomanager.h Mon Jun 10 15:36:31 2019
@@ -144,10 +144,10 @@
* @sa commit()
*/
UndoTransaction beginTransaction(const QString &targetName = "",
- QPixmap *targetPixmap = 0,
+ QPixmap *targetPixmap = nullptr,
const QString &actionName = "",
const QString &description = "",
- QPixmap *actionPixmap = 0);
+ QPixmap *actionPixmap = nullptr);
UndoTransaction beginTransaction(const TransactionSettings& settings);
@@ -668,7 +668,7 @@
* @param state UndoSate describing the state (action).
* @param targetPixmap Is used to override the default target icon in this action.
*/
- void action(UndoObject* target, UndoState* state, QPixmap *targetPixmap = 0);
+ void action(UndoObject* target, UndoState* state, QPixmap *targetPixmap = nullptr);
/**
* @brief Adds a new action to the undo stack.
@@ -683,7 +683,7 @@
* @param targetName Is used to override the default target name in this action.
* @param targetPixmap Is used to override the default target icon in this action.
*/
- void action(UndoObject* target, UndoState* state, const QString &targetName, QPixmap *targetPixmap = 0);
+ void action(UndoObject* target, UndoState* state, const QString &targetName, QPixmap *targetPixmap = nullptr);
/**
* @brief Informs UndoManager to perform undo
Modified: trunk/Scribus/scribus/undoobject.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/undoobject.h
==============================================================================
--- trunk/Scribus/scribus/undoobject.h (original)
+++ trunk/Scribus/scribus/undoobject.h Mon Jun 10 15:36:31 2019
@@ -69,7 +69,7 @@
* @brief Creates a new UndoObject instance with the name <code>objectName</code>
* @param objectName Name of the UndoObject
*/
- UndoObject(const QString &objectName, QPixmap *objectIcon = 0);
+ UndoObject(const QString &objectName, QPixmap *objectIcon = nullptr);
/** @brief Destroys the object. */
virtual ~UndoObject();
Modified: trunk/Scribus/scribus/undostate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/undostate.cpp
==============================================================================
--- trunk/Scribus/scribus/undostate.cpp (original)
+++ trunk/Scribus/scribus/undostate.cpp Mon Jun 10 15:36:31 2019
@@ -351,3 +351,10 @@
}
}
}
+
+void* ScItemsState::getItem(const QString& itemname) const
+{
+ if (pointerMap.contains(itemname))
+ return pointerMap.value(itemname, nullptr);
+ return nullptr;
+}
Modified: trunk/Scribus/scribus/undostate.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/undostate.h
==============================================================================
--- trunk/Scribus/scribus/undostate.h (original)
+++ trunk/Scribus/scribus/undostate.h Mon Jun 10 15:36:31 2019
@@ -66,7 +66,7 @@
* @param description Description of the state (action)
* @param pixmap Pointer to an icon describing the action visually.
*/
- UndoState(const QString& name, const QString& description = 0, QPixmap* pixmap = 0);
+ UndoState(const QString& name, const QString& description = 0, QPixmap* pixmap = nullptr);
virtual ~UndoState();
@@ -152,7 +152,7 @@
* @param description Description of the state (action)
* @param pixmap Pointer to an icon describing the state (action) visually.
*/
- SimpleState(const QString& name, const QString& description = 0, QPixmap* pixmap = 0);
+ SimpleState(const QString& name, const QString& description = 0, QPixmap* pixmap = nullptr);
virtual ~SimpleState();
@@ -321,7 +321,7 @@
class ScItemState : public SimpleState
{
public:
- ScItemState(const QString& name, const QString& description = 0, QPixmap* pixmap = 0)
+ ScItemState(const QString& name, const QString& description = 0, QPixmap* pixmap = nullptr)
: SimpleState(name, description, pixmap) {}
~ScItemState() {}
@@ -337,12 +337,12 @@
class ScItemsState : public SimpleState
{
public:
- ScItemsState(const QString& name, const QString& description = 0, QPixmap* pixmap = 0)
+ ScItemsState(const QString& name, const QString& description = 0, QPixmap* pixmap = nullptr)
: SimpleState(name, description, pixmap) {}
~ScItemsState() {}
void insertItem(QString itemname, void * item) { pointerMap.insert(itemname, item); }
- void* getItem(QString itemname) const { if (pointerMap.contains(itemname)) return pointerMap.value(itemname, NULL); else return NULL;}
+ void* getItem(const QString& itemname) const;
QList< QPair<void*, int> > insertItemPos;
private:
Modified: trunk/Scribus/scribus/undotransaction.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/undotransaction.h
==============================================================================
--- trunk/Scribus/scribus/undotransaction.h (original)
+++ trunk/Scribus/scribus/undotransaction.h Mon Jun 10 15:36:31 2019
@@ -54,7 +54,7 @@
QPixmap *targetPixmap,
const QString &name = "",
const QString &description = "",
- QPixmap *actionPixmap = 0);
+ QPixmap *actionPixmap = nullptr);
};
/**
@@ -64,11 +64,8 @@
class TransactionData : public Transaction::TransactionStateBase
{
public:
- TransactionData() {
- stackLevel = 0;
- UM = 0;
- transactionObject = 0;
- transactionState = 0;
+ TransactionData()
+ {
}
~TransactionData() {
@@ -78,10 +75,10 @@
delete transactionState;*/
}
- int stackLevel;
- UndoManager* UM;
- UndoObject* transactionObject; // will be DummyUndoObject
- TransactionState* transactionState;
+ int stackLevel {0};
+ UndoManager* UM {nullptr};
+ UndoObject* transactionObject {nullptr}; // will be DummyUndoObject
+ TransactionState* transactionState {nullptr};
};
#endif
Modified: trunk/Scribus/scribus/updatemanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/updatemanager.h
==============================================================================
--- trunk/Scribus/scribus/updatemanager.h (original)
+++ trunk/Scribus/scribus/updatemanager.h Mon Jun 10 15:36:31 2019
@@ -65,14 +65,14 @@
class SCRIBUS_API UpdateManager
{
- int m_updatesDisabled;
+ int m_updatesDisabled {0};
QSet<QPair<UpdateManaged*, UpdateMemento*> > m_pending;
public:
- UpdateManager() : m_updatesDisabled(0), m_pending() {}
+ UpdateManager() {}
virtual ~UpdateManager();
- void setUpdatesEnabled(bool val=true);
+ void setUpdatesEnabled(bool val = true);
void setUpdatesDisabled() { setUpdatesEnabled(false); };
bool updatesEnabled() { return m_updatesDisabled == 0; };
/**
Modified: trunk/Scribus/scribus/util_ghostscript.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23017&path=/trunk/Scribus/scribus/util_ghostscript.h
==============================================================================
--- trunk/Scribus/scribus/util_ghostscript.h (original)
+++ trunk/Scribus/scribus/util_ghostscript.h Mon Jun 10 15:36:31 2019
@@ -42,9 +42,9 @@
int SCRIBUS_API callGS(const QString& args_in, const QString& device="");
int SCRIBUS_API convertPS2PS(const QString& in, const QString& out, const QStringList& opts, int level);
int SCRIBUS_API convertPS2PDF(const QString& in, const QString& out, const QStringList& opts);
-bool SCRIBUS_API testGSAvailability( void );
-bool SCRIBUS_API testGSAvailability( const QString& gsPath );
-bool SCRIBUS_API testGSDeviceAvailability( const QString& device );
+bool SCRIBUS_API testGSAvailability();
+bool SCRIBUS_API testGSAvailability(const QString& gsPath);
+bool SCRIBUS_API testGSDeviceAvailability(const QString& device);
/*! \brief Return gs version. If gs couldn't be found or there was a problem parsing output, return false
(in which case minor and major have undefined values).
\retval QString version or false on error */
@@ -52,6 +52,6 @@
bool SCRIBUS_API getNumericGSVersion(int &version);
bool SCRIBUS_API getNumericGSVersion(int & major, int & minor);
bool SCRIBUS_API getNumericGSVersion(const QString& ver, int&major, int& minor);
-QString SCRIBUS_API getGSDefaultExeName(void);
+QString SCRIBUS_API getGSDefaultExeName();
QMap<int, QString> SCRIBUS_API getGSExePaths(const QString& regKey, bool alternateView = false);
#endif
More information about the scribus-commit
mailing list