r23210 by craig - Code cleanup across the board
scribus-commit
scribus-commit at lists.scribus.net
Mon Sep 23 21:57:39 UTC 2019
Author: craig
Date: Mon Sep 23 21:57:38 2019
New Revision: 23210
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23210
Log:
Code cleanup across the board
Modified:
trunk/Scribus/README
trunk/Scribus/Scribus.pro
trunk/Scribus/scribus/canvasmode_normal.cpp
trunk/Scribus/scribus/collect4output.cpp
trunk/Scribus/scribus/collect4output.h
trunk/Scribus/scribus/colormgmt/sccolormgmtenginedata.h
trunk/Scribus/scribus/colormgmt/sccolormgmtenginefactory.cpp
trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.cpp
trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.h
trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
trunk/Scribus/scribus/filesearch.h
trunk/Scribus/scribus/gtgettext.h
trunk/Scribus/scribus/gtstyle.cpp
trunk/Scribus/scribus/gtwriter.cpp
trunk/Scribus/scribus/gtwriter.h
trunk/Scribus/scribus/guidemanagercore.h
trunk/Scribus/scribus/guidesdelegate.cpp
trunk/Scribus/scribus/guidesdelegate.h
trunk/Scribus/scribus/guidesmodel.cpp
trunk/Scribus/scribus/guidesmodel.h
trunk/Scribus/scribus/guidesview.h
trunk/Scribus/scribus/langmgr.h
trunk/Scribus/scribus/loadsaveplugin.cpp
trunk/Scribus/scribus/main_nix.cpp
trunk/Scribus/scribus/main_win32.cpp
trunk/Scribus/scribus/palettes/paletteloader.cpp
trunk/Scribus/scribus/palettes/paletteloader.h
trunk/Scribus/scribus/pluginmanager.h
trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp
trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h
trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h
trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.h
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
trunk/Scribus/scribus/plugins/fontpreview/fontpreview.h
trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.h
trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.h
trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
trunk/Scribus/scribus/plugins/picbrowser/pictview.cpp
trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp
trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.h
trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h
trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnectdialog.h
trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h
trunk/Scribus/scribus/pp_proxy.h
trunk/Scribus/scribus/prefsmanager.cpp
trunk/Scribus/scribus/resourcecollection.h
trunk/Scribus/scribus/scclocale.h
trunk/Scribus/scribus/scdocoutput.h
trunk/Scribus/scribus/scfonts.cpp
trunk/Scribus/scribus/scfonts.h
trunk/Scribus/scribus/scgtplugin.cpp
trunk/Scribus/scribus/scgtplugin.h
trunk/Scribus/scribus/scguardedptr.h
trunk/Scribus/scribus/sclayer.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusdoc.h
trunk/Scribus/scribus/tableborder.cpp
trunk/Scribus/scribus/ui/colorlistmodel.cpp
trunk/Scribus/scribus/ui/colorsandfills.cpp
trunk/Scribus/scribus/ui/cpalette.cpp
trunk/Scribus/scribus/ui/gradientpreview.cpp
trunk/Scribus/scribus/ui/missing.h
trunk/Scribus/scribus/ui/modetoolbar.h
trunk/Scribus/scribus/ui/movepage.h
trunk/Scribus/scribus/ui/multipleduplicate.cpp
trunk/Scribus/scribus/ui/multiprogressdialog.cpp
trunk/Scribus/scribus/ui/multiprogressdialog.h
trunk/Scribus/scribus/ui/newfile.cpp
trunk/Scribus/scribus/ui/newfile.h
trunk/Scribus/scribus/ui/newmarginwidget.cpp
trunk/Scribus/scribus/ui/newmarginwidget.h
trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
trunk/Scribus/scribus/ui/prefs_userinterface.cpp
trunk/Scribus/scribus/ui/propertiespalette_table.cpp
trunk/Scribus/scribus/ui/smtextstyles.cpp
trunk/Scribus/scribus/ui/symbolpalette.cpp
trunk/Scribus/scribus/ui/transparencypalette.cpp
trunk/Scribus/scribus/upgradechecker.cpp
trunk/Scribus/scribus/urllauncher.h
trunk/Scribus/scribus/util.cpp
trunk/Scribus/scribus/vgradient.cpp
trunk/Scribus/scribus/vgradientex.cpp
Modified: trunk/Scribus/README
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/README
==============================================================================
--- trunk/Scribus/README (original)
+++ trunk/Scribus/README Mon Sep 23 21:57:38 2019
@@ -11,7 +11,7 @@
==General==
-Qt 5: As of version 1.5.5, Scribus is being built using version 5.10 of the Qt toolkit.
+Qt 5: As of version 1.5.6, Scribus is being built using version 5.10 of the Qt toolkit.
More dependencies: Scribus 1.5.x makes extensive use of many more external libraries than earlier versions, especially for import filters. In most cases Scribus needs to be explicitly compiled against these libraries, so they become dependencies. In other cases (e.g. UniConvertor), Scribus will detect an installed version automatically. Note that full support for some libraries may not be available on Mac OS X and Windows until the final 1.6.0 release.
Modified: trunk/Scribus/Scribus.pro
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/Scribus.pro
==============================================================================
--- trunk/Scribus/Scribus.pro (original)
+++ trunk/Scribus/Scribus.pro Mon Sep 23 21:57:38 2019
@@ -1,5 +1,5 @@
######################################################################
-# Automatically generated by qmake (3.1) Wed Aug 7 21:21:13 2019
+# Automatically generated by qmake (3.1) Mon Sep 23 23:39:46 2019
######################################################################
INCLUDEPATH+=./scribus
@@ -65,11 +65,9 @@
scribus/collapsedtablepainter.h \
scribus/collapsedtablepainterex.h \
scribus/collect4output.h \
- scribus/color.h \
scribus/colorblind.h \
scribus/colorsetmanager.h \
scribus/commonstrings.h \
- scribus/crypt.h \
scribus/deferredtask.h \
scribus/docinfo.h \
scribus/documentbuilder.h \
Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Mon Sep 23 21:57:38 2019
@@ -1803,7 +1803,7 @@
}
allFormats += "*.sce *.SCE);;";
formats.append("Scribus Objects (*.sce *.SCE)");
- qSort(formats);
+ formats.sort();
allFormats += formats.join(";;");
PrefsContext* dirs = PrefsManager::instance().prefsFile->getContext("dirs");
QString wdir = dirs->get("pastefile", ".");
Modified: trunk/Scribus/scribus/collect4output.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/collect4output.cpp
==============================================================================
--- trunk/Scribus/scribus/collect4output.cpp (original)
+++ trunk/Scribus/scribus/collect4output.cpp Mon Sep 23 21:57:38 2019
@@ -33,7 +33,6 @@
CollectForOutput::CollectForOutput(ScribusDoc* doc, const QString& outputDirectory, bool withFonts, bool withProfiles, bool compressDoc)
: QObject(ScCore),
m_Doc(nullptr),
- m_outputDirectory(QString::null),
profileCount(0),
itemCount(0),
fontCount(0),
@@ -41,7 +40,7 @@
uiCollect(false)
{
m_Doc=doc;
- if (outputDirectory!=QString::null)
+ if (!outputDirectory.isEmpty())
m_outputDirectory=outputDirectory;
m_compressDoc = compressDoc;
m_withFonts = withFonts;
@@ -148,7 +147,7 @@
collectedFiles.clear();
newFileName = newName;
- return QString::null;
+ return QString();
}
bool CollectForOutput::collectDocument()
Modified: trunk/Scribus/scribus/collect4output.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/collect4output.h
==============================================================================
--- trunk/Scribus/scribus/collect4output.h (original)
+++ trunk/Scribus/scribus/collect4output.h Mon Sep 23 21:57:38 2019
@@ -35,7 +35,7 @@
\param withProfiles collect/move CMS profiles into output directory too
\param compressDoc use gzipped document
*/
- CollectForOutput(ScribusDoc* doc, const QString& outputDirectory=QString::null, bool withFonts=false, bool withProfiles=false, bool compressDoc=false);
+ CollectForOutput(ScribusDoc* doc, const QString& outputDirectory=QString(), bool withFonts=false, bool withProfiles=false, bool compressDoc=false);
~CollectForOutput() override = default;
/*! \brief Main method doing everything.
Modified: trunk/Scribus/scribus/colormgmt/sccolormgmtenginedata.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/colormgmt/sccolormgmtenginedata.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolormgmtenginedata.h (original)
+++ trunk/Scribus/scribus/colormgmt/sccolormgmtenginedata.h Mon Sep 23 21:57:38 2019
@@ -31,7 +31,7 @@
ScColorMgmtEngineData(const QString& desc, int uniqueID) : m_engineID(uniqueID),
m_description(desc)
{}
- virtual ~ScColorMgmtEngineData() {};
+ virtual ~ScColorMgmtEngineData() = default;
// Getters
int engineID() const { return m_engineID; }
Modified: trunk/Scribus/scribus/colormgmt/sccolormgmtenginefactory.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/colormgmt/sccolormgmtenginefactory.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolormgmtenginefactory.cpp (original)
+++ trunk/Scribus/scribus/colormgmt/sccolormgmtenginefactory.cpp Mon Sep 23 21:57:38 2019
@@ -12,7 +12,7 @@
ScColorMgmtEngineFactory colorMgmtEngineFactory;
-ScColorMgmtEngine ScColorMgmtEngineFactory::createEngine(int engineID)
+ScColorMgmtEngine ScColorMgmtEngineFactory::createEngine(int /*engineID*/)
{
// for now just return default engine
return createDefaultEngine();
@@ -22,4 +22,4 @@
{
ScColorMgmtEngine lcms2Engine(new ScLcms2ColorMgmtEngineImpl());
return lcms2Engine;
-}
+}
Modified: trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.cpp (original)
+++ trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.cpp Mon Sep 23 21:57:38 2019
@@ -8,7 +8,7 @@
#include "sccolormgmtimplelem.h"
ScColorProfileImplBase::ScColorProfileImplBase(const ScColorMgmtEngine& engine)
- : m_engine(engine)
+ : m_engine(engine)
{
}
@@ -24,7 +24,7 @@
}
ScColorTransformImplBase::ScColorTransformImplBase(const ScColorMgmtEngine& engine)
- : m_engine(engine)
+ : m_engine(engine)
{
}
@@ -37,4 +37,4 @@
const ScColorMgmtEngine& ScColorTransformImplBase::engine() const
{
return m_engine;
-}
+}
Modified: trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.h (original)
+++ trunk/Scribus/scribus/colormgmt/sccolormgmtimplelem.h Mon Sep 23 21:57:38 2019
@@ -19,8 +19,8 @@
public:
ScColorProfileImplBase(const ScColorMgmtEngine& engine);
- virtual ScColorMgmtEngine& engine();
- virtual const ScColorMgmtEngine& engine() const;
+ ScColorMgmtEngine& engine() override;
+ const ScColorMgmtEngine& engine() const override;
};
class ScColorTransformImplBase : public ScColorTransformData
@@ -31,8 +31,8 @@
public:
ScColorTransformImplBase(const ScColorMgmtEngine& engine);
- virtual ScColorMgmtEngine& engine();
- virtual const ScColorMgmtEngine& engine() const;
+ ScColorMgmtEngine& engine() override;
+ const ScColorMgmtEngine& engine() const override;
};
-#endif
+#endif
Modified: trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp (original)
+++ trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp Mon Sep 23 21:57:38 2019
@@ -276,8 +276,8 @@
transInfo.inputProfile.clear();
transInfo.outputProfile.clear();
transInfo.proofingProfile.clear();
- transInfo.renderIntent = (eRenderIntent) 0;
- transInfo.proofingIntent = (eRenderIntent) 0;
+ transInfo.renderIntent = Intent_Perceptual;
+ transInfo.proofingIntent = Intent_Perceptual;
transInfo.flags = 0;
nullTransform = true;
}
Modified: trunk/Scribus/scribus/filesearch.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/filesearch.h
==============================================================================
--- trunk/Scribus/scribus/filesearch.h (original)
+++ trunk/Scribus/scribus/filesearch.h Mon Sep 23 21:57:38 2019
@@ -40,7 +40,7 @@
\warning It's useless to set caseSensitive on MS Windows! This will be set to
false on windows automatically because Windows are case insensitive already.
*/
- FileSearch(QObject* parent, const QString & fileName, const QString & searchBase = QString::null, int depthLimit = -1, bool caseSensitive=true);
+FileSearch(QObject* parent, const QString& fileName, const QString& searchBase = QString(), int depthLimit = -1, bool caseSensitive=true);
~FileSearch();
Modified: trunk/Scribus/scribus/gtgettext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/gtgettext.h
==============================================================================
--- trunk/Scribus/scribus/gtgettext.h (original)
+++ trunk/Scribus/scribus/gtgettext.h Mon Sep 23 21:57:38 2019
@@ -86,7 +86,7 @@
~gtGetText(); // Destructor
QStringList getSupportedTypes(); // get all Fileextensions we support
ImportSetup run(); // Creates the dialog for the user to import a file based on the supported file formats.
- void launchImporter(int importer, const QString& filename, bool textOnly, const QString& encoding, bool append, bool prefix, PageItem* target=0);
+ void launchImporter(int importer, const QString& filename, bool textOnly, const QString& encoding, bool append, bool prefix, PageItem* target=nullptr);
// Look at the results of the file selection dialog and figure out if you need to use an importer.
// Prompt the user if the importer to use isn't obvious.
};
Modified: trunk/Scribus/scribus/gtstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/gtstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/gtstyle.cpp (original)
+++ trunk/Scribus/scribus/gtstyle.cpp Mon Sep 23 21:57:38 2019
@@ -62,7 +62,4 @@
return QString("character");
}
-gtStyle::~gtStyle()
-{
-
-}
+gtStyle::~gtStyle() = default;
Modified: trunk/Scribus/scribus/gtwriter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/gtwriter.cpp
==============================================================================
--- trunk/Scribus/scribus/gtwriter.cpp (original)
+++ trunk/Scribus/scribus/gtwriter.cpp Mon Sep 23 21:57:38 2019
@@ -33,16 +33,10 @@
gtWriter::gtWriter(bool append, PageItem *pageitem)
{
m_action = new gtAction(append, pageitem);
- m_defaultStyle = nullptr;
- m_currentStyle = nullptr;
- m_errorSet = false;
-
m_action->setProgressInfo();
setDefaultStyle();
unsetCharacterStyle();
unsetParagraphStyle();
- inNote = false;
- inNoteBody = false;
}
gtFrameStyle* gtWriter::getDefaultStyle()
Modified: trunk/Scribus/scribus/gtwriter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/gtwriter.h
==============================================================================
--- trunk/Scribus/scribus/gtwriter.h (original)
+++ trunk/Scribus/scribus/gtwriter.h Mon Sep 23 21:57:38 2019
@@ -60,13 +60,13 @@
void setUpdateParagraphStyles(bool newUPS);
bool getOverridePStyleFont();
void setOverridePStyleFont(bool newOPSF);
- bool inNote;
- bool inNoteBody;
+ bool inNote {false};
+ bool inNoteBody {false};
private:
- gtAction *m_action;
- gtFrameStyle* m_defaultStyle;
- gtStyle* m_currentStyle;
+ gtAction *m_action {nullptr};
+ gtFrameStyle* m_defaultStyle {nullptr};
+ gtStyle* m_currentStyle {nullptr};
/*
Frame style is the default style for text. Styles will be used in order so
@@ -74,10 +74,10 @@
style if no paragraph style is found frame style will be used. Last set
frame style will be left to the default style for the text frame.
*/
- gtFrameStyle* m_frameStyle;
- gtStyle* m_paragraphStyle;
- gtStyle* m_characterStyle;
- bool m_errorSet;
+ gtFrameStyle* m_frameStyle {nullptr};
+ gtStyle* m_paragraphStyle {nullptr};
+ gtStyle* m_characterStyle {nullptr};
+ bool m_errorSet {false};
void setDefaultStyle();
};
Modified: trunk/Scribus/scribus/guidemanagercore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/guidemanagercore.h
==============================================================================
--- trunk/Scribus/scribus/guidemanagercore.h (original)
+++ trunk/Scribus/scribus/guidemanagercore.h Mon Sep 23 21:57:38 2019
@@ -140,8 +140,8 @@
class SCRIBUS_API GuideManagerIO
{
public:
- GuideManagerIO(){};
- ~GuideManagerIO(){};
+ GuideManagerIO() = default;
+ ~GuideManagerIO() = default;
/*! \brief Read the guides from XML attribute (file opening).
It's statis method sou you can call it without instance initialized:
Modified: trunk/Scribus/scribus/guidesdelegate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/guidesdelegate.cpp
==============================================================================
--- trunk/Scribus/scribus/guidesdelegate.cpp (original)
+++ trunk/Scribus/scribus/guidesdelegate.cpp Mon Sep 23 21:57:38 2019
@@ -13,8 +13,7 @@
GuidesDelegate::GuidesDelegate(QObject *parent)
- : QItemDelegate(parent),
- m_doc(nullptr)
+ : QItemDelegate(parent)
{
}
Modified: trunk/Scribus/scribus/guidesdelegate.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/guidesdelegate.h
==============================================================================
--- trunk/Scribus/scribus/guidesdelegate.h (original)
+++ trunk/Scribus/scribus/guidesdelegate.h Mon Sep 23 21:57:38 2019
@@ -22,7 +22,7 @@
Q_OBJECT
public:
- GuidesDelegate(QObject *parent = 0);
+ GuidesDelegate(QObject *parent = nullptr);
// implemented in inheritance
// QWidget *createEditor(QWidget *parent,
@@ -44,7 +44,7 @@
// protected due const in createEditor
protected:
- ScribusDoc *m_doc;
+ ScribusDoc *m_doc {nullptr};
};
@@ -56,7 +56,7 @@
Q_OBJECT
public:
- GuidesHDelegate(QObject *parent = 0);
+ GuidesHDelegate(QObject *parent = nullptr);
QWidget *createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
@@ -72,7 +72,7 @@
Q_OBJECT
public:
- GuidesVDelegate(QObject *parent = 0);
+ GuidesVDelegate(QObject *parent = nullptr);
QWidget *createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
Modified: trunk/Scribus/scribus/guidesmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/guidesmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/guidesmodel.cpp (original)
+++ trunk/Scribus/scribus/guidesmodel.cpp Mon Sep 23 21:57:38 2019
@@ -4,26 +4,19 @@
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
+
+#include <algorithm>
#include <QLocale>
#include "guidesmodel.h"
#include "units.h"
-GuidesModel::GuidesModel(QObject * /*parent*/) :
- m_docUnitIndex(0),
- m_docUnitDecimals(0)
+GuidesModel::GuidesModel(QObject * /*parent*/)
{
- m_rule = 0.0;
- // debug
-// m_values << 1.0 << 10.1 << 6.3 << 4.1;
-// qSort(m_values);
}
-
-GuidesModel::~GuidesModel()
-{
-}
+GuidesModel::~GuidesModel() = default;
int GuidesModel::rowCount(const QModelIndex & /*parent*/) const
{
@@ -71,7 +64,7 @@
if (!ok)
return false;
m_values[index.row()] = value2pts(newVal, m_docUnitIndex) + m_rule;
- qSort(m_values);
+ std::sort(m_values.begin(), m_values.end());
emit dataChanged(index, index);
emit valueChanged();
return true;
@@ -125,7 +118,7 @@
if (m_values.contains(0.0))
return;
m_values.append(0.0);
- qSort(m_values);
+ std::sort(m_values.begin(), m_values.end());
endResetModel();
}
@@ -133,7 +126,7 @@
{
beginResetModel();
m_values = values;
- qSort(m_values);
+ std::sort(m_values.begin(), m_values.end());
endResetModel();
}
Modified: trunk/Scribus/scribus/guidesmodel.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/guidesmodel.h
==============================================================================
--- trunk/Scribus/scribus/guidesmodel.h (original)
+++ trunk/Scribus/scribus/guidesmodel.h Mon Sep 23 21:57:38 2019
@@ -24,7 +24,7 @@
Q_OBJECT
public:
- GuidesModel(QObject * parent = 0);
+ GuidesModel(QObject * parent = nullptr);
~GuidesModel();
int rowCount(const QModelIndex & parent = QModelIndex()) const;
@@ -62,9 +62,9 @@
private:
Guides m_values;
- int m_docUnitIndex;
- int m_docUnitDecimals;
- double m_rule;
+ int m_docUnitIndex {0};
+ int m_docUnitDecimals {0};
+ double m_rule {0.0};
};
#endif
Modified: trunk/Scribus/scribus/guidesview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/guidesview.h
==============================================================================
--- trunk/Scribus/scribus/guidesview.h (original)
+++ trunk/Scribus/scribus/guidesview.h Mon Sep 23 21:57:38 2019
@@ -18,7 +18,7 @@
Q_OBJECT
public:
- GuidesView(QWidget * parent = 0);
+ GuidesView(QWidget * parent = nullptr);
signals:
void deleteKeyPressed();
Modified: trunk/Scribus/scribus/langmgr.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/langmgr.h
==============================================================================
--- trunk/Scribus/scribus/langmgr.h (original)
+++ trunk/Scribus/scribus/langmgr.h Mon Sep 23 21:57:38 2019
@@ -34,7 +34,7 @@
class SCRIBUS_API LanguageManager
{
- LanguageManager() {}
+ LanguageManager() = default;
~LanguageManager();
void init(bool generateInstalledList = true);
Modified: trunk/Scribus/scribus/loadsaveplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/loadsaveplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.cpp (original)
+++ trunk/Scribus/scribus/loadsaveplugin.cpp Mon Sep 23 21:57:38 2019
@@ -4,6 +4,9 @@
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
+
+#include <algorithm>
+
#include "loadsaveplugin.h"
#include "commonstrings.h"
#include "scribuscore.h"
@@ -101,7 +104,7 @@
// Avoid duplicate entries in the list
QSet<QString> fSet = filterList.toSet();
filterList = fSet.toList();
- qSort(filterList);
+ std::sort(filterList.begin(), filterList.end());
return filterList;
}
@@ -137,7 +140,7 @@
// Avoid duplicate entries in the list
QSet<QString> fSet = filterList.toSet();
filterList = fSet.toList();
- qSort(filterList);
+ std::sort(filterList.begin(), filterList.end());
return filterList;
}
@@ -173,7 +176,7 @@
// Avoid duplicate entries in the list
QSet<QString> fSet = filterList.toSet();
filterList = fSet.toList();
- qSort(filterList);
+ std::sort(filterList.begin(), filterList.end());
return filterList;
}
Modified: trunk/Scribus/scribus/main_nix.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/main_nix.cpp
==============================================================================
--- trunk/Scribus/scribus/main_nix.cpp (original)
+++ trunk/Scribus/scribus/main_nix.cpp Mon Sep 23 21:57:38 2019
@@ -26,12 +26,10 @@
***************************************************************************/
#include <iostream>
-#include <signal.h>
+#include <csignal>
#include <QApplication>
#include <QMessageBox>
-
-#define BASE_QM "scribus"
#include "scribusapp.h"
#include "scribuscore.h"
@@ -76,13 +74,13 @@
return(EXIT_FAILURE);
if (app.useGUI)
return app.exec();
- return EXIT_SUCCESS;
+ return EXIT_SUCCESS;
}
void initCrashHandler()
{
typedef void (*HandlerType)(int);
- HandlerType handler = 0;
+ HandlerType handler = nullptr;
handler = defaultCrashHandler;
if (!handler)
handler = SIG_DFL;
@@ -104,7 +102,7 @@
signal (SIGABRT, handler);
sigaddset(&mask, SIGABRT);
#endif
- sigprocmask(SIG_UNBLOCK, &mask, 0);
+ sigprocmask(SIG_UNBLOCK, &mask, nullptr);
}
void defaultCrashHandler(int sig)
Modified: trunk/Scribus/scribus/main_win32.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/main_win32.cpp
==============================================================================
--- trunk/Scribus/scribus/main_win32.cpp (original)
+++ trunk/Scribus/scribus/main_win32.cpp Mon Sep 23 21:57:38 2019
@@ -41,7 +41,6 @@
#include <exception>
using namespace std;
-#define BASE_QM "scribus"
#define MAX_LINES 500
#include "scribusapp.h"
Modified: trunk/Scribus/scribus/palettes/paletteloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/palettes/paletteloader.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader.cpp (original)
+++ trunk/Scribus/scribus/palettes/paletteloader.cpp Mon Sep 23 21:57:38 2019
@@ -8,13 +8,6 @@
#include "paletteloader.h"
#include "sccolor.h"
-#include "scribusdoc.h"
-
-PaletteLoader::PaletteLoader()
-{
- m_colors = nullptr;
- m_gradients = nullptr;
-}
void PaletteLoader::setupTargets(ColorList* colors, QHash<QString, VGradient> *gradients)
{
Modified: trunk/Scribus/scribus/palettes/paletteloader.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/palettes/paletteloader.h
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader.h (original)
+++ trunk/Scribus/scribus/palettes/paletteloader.h Mon Sep 23 21:57:38 2019
@@ -18,7 +18,7 @@
class SCRIBUS_API PaletteLoader
{
public:
- PaletteLoader();
+ PaletteLoader() {};
virtual ~PaletteLoader() {}
// Examine the passed file and test to see whether it appears to be
@@ -34,8 +34,8 @@
virtual void setupTargets(ColorList* colors, QHash<QString, VGradient> *gradients);
protected:
- ColorList* m_colors;
- QHash<QString, VGradient>* m_gradients;
+ ColorList* m_colors {nullptr};
+ QHash<QString, VGradient>* m_gradients {nullptr};
};
#endif
Modified: trunk/Scribus/scribus/pluginmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/pluginmanager.h
==============================================================================
--- trunk/Scribus/scribus/pluginmanager.h (original)
+++ trunk/Scribus/scribus/pluginmanager.h Mon Sep 23 21:57:38 2019
@@ -134,8 +134,7 @@
* \sa getPluginNamesT
* \sa getPlugin
*/
- QStringList pluginNames(bool includeDisabled = false,
- const char* inherits = 0) const;
+ QStringList pluginNames(bool includeDisabled = false, const char* inherits = nullptr) const;
virtual void changeEvent(QEvent *e);
Modified: trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp (original)
+++ trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp Mon Sep 23 21:57:38 2019
@@ -201,10 +201,10 @@
baseColor();
QColor col(ScColorEngine::getRGBColor(actualColor, currentDoc));
ScColor l;
- l.fromQColor(col.light());
+ l.fromQColor(col.lighter());
l = ScColorEngine::convertToModel(l, currentDoc, currentColorSpace);
colorList[tr("Monochromatic Light")] = l;
- l.fromQColor(col.dark());
+ l.fromQColor(col.darker());
l = ScColorEngine::convertToModel(l, currentDoc, currentColorSpace);
colorList[tr("Monochromatic Dark")] = l;
currentType = Monochromatic;
Modified: trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp Mon Sep 23 21:57:38 2019
@@ -31,7 +31,6 @@
setupUi(this);
setObjectName(name);
setModal(modal);
- int h, s, v;
ScColor color;
QString colorName;
connectSlots(false);
@@ -72,6 +71,7 @@
}
// Handle achromatic colors
QColor rgb = ScColorEngine::getRGBColor(color, m_Doc);
+ int h, s, v;
rgb.getHsv(&h, &s, &v);
if (h == -1)
{ // Reset to defaults
Modified: trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h (original)
+++ trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h Mon Sep 23 21:57:38 2019
@@ -32,7 +32,7 @@
{
Q_OBJECT
public:
- CWDialog(QWidget* parent = 0, ScribusDoc* doc = 0, const char* name = 0, bool modal = false);
+ CWDialog(QWidget* parent = nullptr, ScribusDoc* doc = nullptr, const char* name = nullptr, bool modal = false);
~CWDialog();
private:
/** \brief Configuration structure */
@@ -108,16 +108,16 @@
void cancelButton_clicked();
void colorList_currentChanged(const QString& text);
- void cSpin_valueChanged( int );
- void mSpin_valueChanged( int );
- void ySpin_valueChanged( int );
- void kSpin_valueChanged( int );
- void rSpin_valueChanged( int );
- void gSpin_valueChanged( int );
- void bSpin_valueChanged( int );
- void hSpin_valueChanged( int );
- void sSpin_valueChanged( int );
- void vSpin_valueChanged( int );
+ void cSpin_valueChanged(int);
+ void mSpin_valueChanged(int);
+ void ySpin_valueChanged(int);
+ void kSpin_valueChanged(int);
+ void rSpin_valueChanged(int);
+ void gSpin_valueChanged(int);
+ void bSpin_valueChanged(int);
+ void hSpin_valueChanged(int);
+ void sSpin_valueChanged(int);
+ void vSpin_valueChanged(int);
};
#endif // CWDIALOG_H
Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h (original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h Mon Sep 23 21:57:38 2019
@@ -42,7 +42,7 @@
\param filename a file to export to
\retval bool true
*/
- virtual bool run(ScribusDoc* doc=0, const QString& filename = QString());
+ virtual bool run(ScribusDoc* doc=nullptr, const QString& filename = QString());
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
@@ -105,7 +105,7 @@
\retval QString Clipping Path
*/
QString SetClipPath(FPointArray *ite, bool closed);
- QDomElement createClipPathElement(FPointArray *ite, QDomElement* pathElem = 0);
+ QDomElement createClipPathElement(FPointArray *ite, QDomElement* pathElem = nullptr);
/*!
\author Franz Schmid
\brief Converts double to string
Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.h
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.h (original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.h Mon Sep 23 21:57:38 2019
@@ -44,7 +44,7 @@
\param filename a file to export to
\retval bool true
*/
- virtual bool run(ScribusDoc* doc=0, const QString& filename = QString());
+ virtual bool run(ScribusDoc* doc=nullptr, const QString& filename = QString());
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h Mon Sep 23 21:57:38 2019
@@ -57,8 +57,8 @@
/**
* @brief Paste an item to the document.
* The bulk of a paste item process runs here for want of a better place, but its a better place
- * than the view where it used to be.
- * TODO Once the pageitem restructure is done, this is probably unnecessary but it removes the
+ * than the view where it used to be.
+ * TODO Once the pageitem restructure is done, this is probably unnecessary but it removes the
* unnecessary part from the view for now which is overloaded with non ScrollView code.
*/
//TODO: void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false);
@@ -259,7 +259,7 @@
};
void PasteItem(struct CopyPasteBuffer *Buffer, bool drag = false, bool noResize = true);
void GetItemProps(QDomElement *obj, struct CopyPasteBuffer *OB, const QString& baseDir, bool newVersion);
-
+
};
extern "C" PLUGIN_API int scribus12format_getPluginAPIVersion();
Modified: trunk/Scribus/scribus/plugins/fontpreview/fontpreview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/fontpreview/fontpreview.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fontpreview/fontpreview.h (original)
+++ trunk/Scribus/scribus/plugins/fontpreview/fontpreview.h Mon Sep 23 21:57:38 2019
@@ -30,7 +30,7 @@
/*! \brief Create Font Preview window,
\param fontName Optional name of the font to init/select on start.
*/
- FontPreview(const QString& fontName = QString(), QWidget* parent = 0, ScribusDoc* doc=0);
+ FontPreview(const QString& fontName = QString(), QWidget* parent = nullptr, ScribusDoc* doc=nullptr);
~FontPreview();
/*! \brief Get the current selected font name.
Modified: trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp Mon Sep 23 21:57:38 2019
@@ -49,7 +49,6 @@
ODTIm::ODTIm(const QString& fileName, PageItem *textItem, bool textOnly, bool prefix, bool append)
{
- uz=nullptr;
m_Doc = textItem->doc();
m_item = textItem;
m_prefixName = prefix;
Modified: trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.h
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.h (original)
+++ trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.h Mon Sep 23 21:57:38 2019
@@ -32,68 +32,40 @@
class ObjStyleODT
{
public:
- ObjStyleODT() :
- CurrColorText("Black"),
- CurrColorBText(CommonStrings::None),
- CurrColorBPara(CommonStrings::None),
- fontName(""),
- fontStyle(""),
- fontWeight(""),
- fontSize(10.0),
- textIndent(0.0),
- textAlign(ParagraphStyle::LeftAligned),
- textPos(""),
- textOutline(""),
- textUnderline(false),
- textUnderlineWords(false),
- textUnderlineColor(CommonStrings::None),
- textStrikeThrough(false),
- textShadow(false),
- textSmallCaps(false),
- lineHeight(1.0),
- absLineHeight(false),
- margin_top(0.0),
- margin_bottom(0.0),
- margin_left(0.0),
- margin_right(0.0),
- verticalAlignment(0),
- tabStops(),
- breakBefore("auto"),
- breakAfter("auto")
- {}
- QString CurrColorText;
- QString CurrColorBText;
- QString CurrColorBPara;
- QString fontName;
- QString fontStyle;
- QString fontWeight;
- double fontSize;
- double textIndent;
- ParagraphStyle::AlignmentType textAlign; // 0 = left
- QString textPos;
- QString textOutline;
- bool textUnderline;
- bool textUnderlineWords;
- QString textUnderlineColor;
- bool textStrikeThrough;
- bool textShadow;
- bool textSmallCaps;
- double lineHeight;
- bool absLineHeight;
- double margin_top;
- double margin_bottom;
- double margin_left;
- double margin_right;
- int verticalAlignment;
+ ObjStyleODT() {}
+ QString CurrColorText {"Black"};
+ QString CurrColorBText {CommonStrings::None};
+ QString CurrColorBPara {CommonStrings::None};
+ QString fontName;
+ QString fontStyle;
+ QString fontWeight;
+ double fontSize {10.0};
+ double textIndent {0.0};
+ ParagraphStyle::AlignmentType textAlign {ParagraphStyle::LeftAligned};
+ QString textPos;
+ QString textOutline;
+ bool textUnderline {false};
+ bool textUnderlineWords {false};
+ QString textUnderlineColor {CommonStrings::None};
+ bool textStrikeThrough {false};
+ bool textShadow {false};
+ bool textSmallCaps {false};
+ double lineHeight {1.0};
+ bool absLineHeight {false};
+ double margin_top {0.0};
+ double margin_bottom {0.0};
+ double margin_left {0.0};
+ double margin_right {0.0};
+ int verticalAlignment {0};
QList<ParagraphStyle::TabRecord> tabStops;
- QString breakBefore;
- QString breakAfter;
+ QString breakBefore {"auto"};
+ QString breakAfter {"auto"};
};
class ODTIm
{
public:
- ODTIm(const QString& fileName, PageItem *textItem, bool textOnly, bool prefix, bool append);
+ ODTIm(const QString& fileName, PageItem *textItem, bool textOnly, bool prefix, bool append);
~ODTIm();
private:
struct DrawStyle
@@ -152,11 +124,11 @@
QString parseColor( const QString &s );
QString constructFontName(const QString& fontBaseName, const QString& fontStyle);
void setFontstyle(CharStyle &tmpCStyle, int kind);
- ScZipHandler *uz;
- ScribusDoc* m_Doc;
- PageItem* m_item;
- bool m_prefixName;
- bool m_append;
+ ScZipHandler *uz {nullptr};
+ ScribusDoc* m_Doc {nullptr};
+ PageItem* m_item {nullptr};
+ bool m_prefixName {false};
+ bool m_append {false};
QHash<QString, QString> map_ID_to_Name;
QHash<QString, QString> m_fontMap;
QHash<QString, DrawStyle> m_Styles;
Modified: trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.h
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.h (original)
+++ trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.h Mon Sep 23 21:57:38 2019
@@ -72,7 +72,7 @@
Word numRecords;
} pdb_header;
-/*! \brief Some compilers pad structures out to DWord boundaries so using
+/*! \brief Some compilers pad structures out to DWord boundaries so using
sizeof() doesn't give the intended result.
*/
#define PDB_HEADER_SIZE 78
@@ -136,7 +136,7 @@
bool m_littlendian;
//! \brief A "document uses that strange compress algorithm" flag.
bool bCompressed;
-
+
/*! \brief Parse the PDB file.
\param fname a filename to open */
void loadFile(const QString& fname);
Modified: trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp Mon Sep 23 21:57:38 2019
@@ -1828,7 +1828,7 @@
{
QColor back = ScColorEngine::getRGBColor(m_Doc->PageColors[fillColor], m_Doc);
QColor fore = ScColorEngine::getRGBColor(m_Doc->PageColors[backColor], m_Doc);
- QString patNa = QString("%1%2%3").arg(back.name()).arg(fore.name()).arg(ind);
+ QString patNa = QString("%1%2%3").arg(back.name(), fore.name()).arg(ind);
QString patternName;
if (!patternMap.contains(patNa))
{
@@ -1950,7 +1950,10 @@
QString DrwPlug::getColor(QDataStream &ds)
{
- quint8 r, g, b, a;
+ quint8 r;
+ quint8 g;
+ quint8 b;
+ quint8 a;
ds >> r >> g >> b >> a;
ScColor color = ScColor(r, g, b);
return handleColor(color, "FromDRW"+color.name());
Modified: trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pct/importpct.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pct/importpct.cpp Mon Sep 23 21:57:38 2019
@@ -2163,7 +2163,7 @@
quint32 patDat1, patDat2;
QDataStream bu(&patternData, QIODevice::ReadOnly);
bu >> patDat1 >> patDat2;
- QString patNa = QString("%1%2%3%4").arg(backColor.name()).arg(foreColor.name()).arg(patDat1, 8, 16, QLatin1Char('0')).arg(patDat2, 8, 16, QLatin1Char('0'));
+ QString patNa = QString("%1%2%3%4").arg(backColor.name(), foreColor.name()).arg(patDat1, 8, 16, QLatin1Char('0')).arg(patDat2, 8, 16, QLatin1Char('0'));
if (!patternMap.contains(patNa))
{
QImage image = QImage(8, 8, QImage::Format_Mono);
Modified: trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp Mon Sep 23 21:57:38 2019
@@ -4,6 +4,8 @@
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
+
+#include <algorithm>
#include <QByteArray>
#include <QCursor>
@@ -1563,7 +1565,7 @@
if ((importerFlags & LoadSavePlugin::lfCreateDoc) && (it > 0))
currentLayer = m_Doc->addLayer(QString("Layer %1").arg(it), true);
QList<int> elems = depthMap.values(keylist.at(it));
- qSort(elems);
+ std::sort(elems.begin(), elems.end());
int itemsCount = elems.count();
for (int i = 0; i < itemsCount; ++i)
{
Modified: trunk/Scribus/scribus/plugins/picbrowser/pictview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/picbrowser/pictview.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/pictview.cpp (original)
+++ trunk/Scribus/scribus/plugins/picbrowser/pictview.cpp Mon Sep 23 21:57:38 2019
@@ -66,7 +66,7 @@
{
drag->setPixmap(icn.pixmap(64,64));
}
- drag->start();
+ drag->exec(Qt::CopyAction);
}
}
Modified: trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp (original)
+++ trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp Mon Sep 23 21:57:38 2019
@@ -16,15 +16,17 @@
*
******************************************************************/
+#include <algorithm>
+
+#include <QPainter>
+#include <QUrl>
+
#include "previewimage.h"
#include "picturebrowser.h"
#include "collection.h"
#include "iconmanager.h"
#include "util.h"
-
-#include <QPainter>
-#include <QUrl>
// //functions for comparing attributes of previewimages (used for sorting)
bool comparePreviewImageFileName ( const previewImage *i1, const previewImage *i2 );
@@ -304,40 +306,40 @@
void previewImages::sortPreviewImages ( const int sort )
{
- if(0 == previewImagesList.count())
+ if(previewImagesList.isEmpty())
return;
switch ( sort )
{
//sort by filename
case 0:
- qSort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileName );
+ std::sort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileName );
break;
case 1:
//sort by filedate
- qSort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileType );
+ std::sort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileType );
break;
case 2:
//sort by filetype
- qSort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileDate );
+ std::sort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileDate );
break;
case 3:
//sort by filesize
- qSort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileSize );
+ std::sort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileSize );
break;
case 4:
//sort by imageresolution
- qSort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageResolution );
+ std::sort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageResolution );
break;
default:
break;
//if a wrong argument was specified, sort by name
- qSort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileName );
+ std::sort ( previewImagesList.begin(), previewImagesList.end(), comparePreviewImageFileName );
}
}
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp Mon Sep 23 21:57:38 2019
@@ -226,10 +226,8 @@
QStringList propertyNames;
int propertyOffset = includesuper ? 0 : objmeta->propertyOffset();
for (int i = propertyOffset; i < objmeta->propertyCount(); ++i)
- {
- QString propName = objmeta->property(i).name();
propertyNames << QString::fromLatin1(objmeta->property(i).name());
- }
+
return convert_QStringList_to_PyListObject(propertyNames);
}
Modified: trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp Mon Sep 23 21:57:38 2019
@@ -46,7 +46,7 @@
action_Run->setShortcut(Qt::Key_F9);
actionRun_As_Console->setShortcut(Qt::CTRL + Qt::Key_F9);
- commandEdit->setTabStopWidth(qRound(commandEdit->fontPointSize() * 4));
+ commandEdit->setTabStopDistance(qRound(commandEdit->fontPointSize() * 4));
// install syntax highlighter.
new SyntaxHighlighter(commandEdit);
@@ -55,7 +55,7 @@
commandEdit_cursorPositionChanged();
// welcome note
- QString welcomeText("\"\"\"");
+ QString welcomeText(R"(""")");
welcomeText += tr("Scribus Python Console");
welcomeText += "\n\n";
welcomeText += tr(
@@ -78,9 +78,7 @@
connect(action_Save_Output, SIGNAL(triggered()), this, SLOT(slot_saveOutput()));
}
-PythonConsole::~PythonConsole()
-{
-}
+PythonConsole::~PythonConsole() = default;
void PythonConsole::updateSyntaxHighlighter()
{
@@ -394,21 +392,22 @@
void SyntaxColors::saveToPrefs()
{
PrefsContext* prefs = PrefsManager::instance().prefsFile->getPluginContext("scriptplugin");
- if (prefs)
- {
- prefs->set("syntaxerror", qcolor2named(errorColor));
- prefs->set("syntaxcomment", qcolor2named(commentColor));
- prefs->set("syntaxkeyword", qcolor2named(keywordColor));
- prefs->set("syntaxsign", qcolor2named(signColor));
- prefs->set("syntaxnumber", qcolor2named(numberColor));
- prefs->set("syntaxstring", qcolor2named(stringColor));
- prefs->set("syntaxtext", qcolor2named(textColor));
- }
+ if (!prefs)
+ return;
+ prefs->set("syntaxerror", qcolor2named(errorColor));
+ prefs->set("syntaxcomment", qcolor2named(commentColor));
+ prefs->set("syntaxkeyword", qcolor2named(keywordColor));
+ prefs->set("syntaxsign", qcolor2named(signColor));
+ prefs->set("syntaxnumber", qcolor2named(numberColor));
+ prefs->set("syntaxstring", qcolor2named(stringColor));
+ prefs->set("syntaxtext", qcolor2named(textColor));
}
QString SyntaxColors::qcolor2named(const QColor& color)
{
- int r, g, b;
+ int r;
+ int g;
+ int b;
QString retval("#");
QString oct;
color.getRgb(&r, &g, &b);
Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp Mon Sep 23 21:57:38 2019
@@ -541,7 +541,7 @@
return;
QTextStream intputstream(&input);
QString content = intputstream.readAll();
- QString docstring = content.section("\"\"\"", 1, 1);
+ QString docstring = content.section(R"(""")", 1, 1);
if (!docstring.isEmpty())
{
html += QString("<h1>%1 %2</h1>").arg( tr("Documentation for:"), fi.fileName());
@@ -549,7 +549,7 @@
}
else
{
- html += QString("<p><b>%1 %2 %3</b></p>").arg( tr("Script")).arg(fi.fileName(), tr(" doesn't contain any docstring!"));
+ html += QString("<p><b>%1 %2 %3</b></p>").arg( tr("Script"), fi.fileName(), tr(" doesn't contain any docstring!"));
html += QString("<pre>%4</pre>").arg(content);
}
html += "</body></html>";
Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp Mon Sep 23 21:57:38 2019
@@ -21,7 +21,7 @@
languageChange();
}
-HunspellPlugin::~HunspellPlugin() {};
+HunspellPlugin::~HunspellPlugin() = default;
void HunspellPlugin::languageChange()
{
Modified: trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.h (original)
+++ trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.h Mon Sep 23 21:57:38 2019
@@ -47,7 +47,7 @@
{
public:
LensItem(QRectF geom, LensDialog *parent);
- ~LensItem() {};
+ ~LensItem() = default;
void setStrength(double s);
void updateEffect();
Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp Mon Sep 23 21:57:38 2019
@@ -50,20 +50,14 @@
delete plug;
}
-PathConnectPlugin::PathConnectPlugin() :
- m_item1(nullptr),
- m_item2(nullptr),
- m_doc(nullptr),
- originalXPos(0.0),
- originalYPos(0.0),
- firstUpdate(false)
+PathConnectPlugin::PathConnectPlugin()
{
// Set action info in languageChange, so we only have to do
// it in one place.
languageChange();
}
-PathConnectPlugin::~PathConnectPlugin() {}
+PathConnectPlugin::~PathConnectPlugin() = default;
void PathConnectPlugin::languageChange()
{
@@ -132,7 +126,7 @@
originalXPos = m_item1->xPos();
originalYPos = m_item1->yPos();
PathConnectDialog *dia = new PathConnectDialog(m_doc->scMW());
- connect(dia, SIGNAL(updateValues(int, int, int, int)), this, SLOT(updateEffect(int, int, int, int)));
+ connect(dia, SIGNAL(updateValues(int,int,int,int)), this, SLOT(updateEffect(int,int,int,int)));
if (dia->exec())
{
int pointOne = dia->getFirstLinePoint();
Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h (original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h Mon Sep 23 21:57:38 2019
@@ -58,16 +58,15 @@
FPointArray computePath(int pointOne, int pointTwo, int mode, FPointArray &p1, FPointArray &p2);
FPointArray reversePath(FPointArray &path);
- PageItem* m_item1;
- PageItem* m_item2;
- ScribusDoc* m_doc;
-
+ PageItem* m_item1 {nullptr};
+ PageItem* m_item2 {nullptr};
+ ScribusDoc* m_doc {nullptr};
FPointArray originalPath1;
FPointArray originalPath2;
- double originalXPos;
- double originalYPos;
-
- bool firstUpdate;
+ double originalXPos {0.0};
+ double originalYPos {0.0};
+ bool firstUpdate {false};
+
private slots:
void updateEffect(int effectType, int pointOne, int pointTwo, int mode);
};
Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnectdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnectdialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnectdialog.h (original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnectdialog.h Mon Sep 23 21:57:38 2019
@@ -39,12 +39,12 @@
public:
PathConnectDialog(QWidget* parent);
- ~PathConnectDialog() {};
+ ~PathConnectDialog() = default;
int getFirstLinePoint();
int getSecondLinePoint();
int getMode();
signals:
- void updateValues(int, int, int, int);
+ void updateValues(int,int,int,int);
private slots:
void pointsChanged();
void togglePreview();
Modified: trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h (original)
+++ trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h Mon Sep 23 21:57:38 2019
@@ -22,7 +22,7 @@
public:
PathFinderDialog(QWidget* parent, ScribusDoc* doc, PageItem *shape1, PageItem *shape2);
- ~PathFinderDialog() {};
+ ~PathFinderDialog() = default;
void updatePreview(QLabel *label, QPainterPath &path, const QColor& color, double scale);
void updatePartPreview(const QColor& color, double scale);
const QString getOtherFillColor();
Modified: trunk/Scribus/scribus/pp_proxy.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/pp_proxy.h
==============================================================================
--- trunk/Scribus/scribus/pp_proxy.h (original)
+++ trunk/Scribus/scribus/pp_proxy.h Mon Sep 23 21:57:38 2019
@@ -19,7 +19,7 @@
{
Q_OBJECT
public:
- explicit PP_Proxy(QObject *parent = 0);
+ explicit PP_Proxy(QObject *parent = nullptr);
signals:
@@ -28,8 +28,8 @@
void setDoc(ScribusDoc* doc);
protected:
- PageItem *m_pageItem;
- ScribusDoc *m_scribusDoc;
+ PageItem *m_pageItem {nullptr};
+ ScribusDoc *m_scribusDoc {nullptr};
void connectDoc();
void connectItem();
Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Mon Sep 23 21:57:38 2019
@@ -1938,10 +1938,11 @@
QTextStream ts(&f);
ts.setCodec("UTF-8");
QString errorMsg;
- int errorLine = 0, errorColumn = 0;
+ int errorLine = 0;
+ int errorColumn = 0;
if( !docu.setContent(ts.readAll(), &errorMsg, &errorLine, &errorColumn) )
{
- m_lastError = tr("Failed to read prefs XML from \"%1\": %2 at line %3, col %4").arg(ho).arg(errorMsg).arg(errorLine).arg(errorColumn);
+ m_lastError = tr("Failed to read prefs XML from \"%1\": %2 at line %3, col %4").arg(ho, errorMsg).arg(errorLine).arg(errorColumn);
f.close();
return false;
}
Modified: trunk/Scribus/scribus/resourcecollection.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/resourcecollection.h
==============================================================================
--- trunk/Scribus/scribus/resourcecollection.h (original)
+++ trunk/Scribus/scribus/resourcecollection.h Mon Sep 23 21:57:38 2019
@@ -42,87 +42,82 @@
*/
class SCRIBUS_API ResourceCollection
{
-public:
- ResourceCollection()
- : availableFonts(NULL),
- availableColors(NULL),
- availableGradients(NULL)
- {}
- void collectFont(const QString& name) { if (!name.isEmpty()) m_fonts.insert(name,name); }
- void collectFontfeatures(const QString& name) { if (!name.isEmpty()) m_fontfeatures.insert(name,name); }
- void collectPattern(const QString& name) { if (!name.isEmpty()) m_patterns.insert(name,name); }
- void collectColor(const QString& name) { if (!name.isEmpty()) m_colors.insert(name,name); }
- void collectGradient(const QString& name) { if (!name.isEmpty()) m_gradients.insert(name,name); }
- void collectStyle(const QString& name) { if (!name.isEmpty()) m_pstyles.insert(name,name); }
- void collectCharStyle(const QString& name) { if (!name.isEmpty()) m_cstyles.insert(name,name); }
- void collectLineStyle(const QString& name) { if (!name.isEmpty()) m_linestyles.insert(name,name); }
- void collectTableStyle(const QString& name) { if (!name.isEmpty()) m_tableStyles.insert(name,name); }
- void collectCellStyle(const QString& name) { if (!name.isEmpty()) m_cellStyles.insert(name,name); }
-
- void mapFont(const QString& oldname, const QString& newname) { m_fonts.insert(oldname, newname); }
- void mapPattern(const QString& oldname, const QString& newname) { m_patterns.insert(oldname, newname); }
- void mapFontfeatures(const QString& oldname, const QString& newname) { m_fontfeatures.insert(oldname, newname); }
- void mapColor(const QString& oldname, const QString& newname) { m_colors.insert(oldname, newname); }
- void mapGradients(const QString& oldname, const QString& newname) { m_gradients.insert(oldname, newname); }
- void mapStyle(const QString& oldname, const QString& newname) { m_pstyles.insert(oldname, newname); }
- void mapCharStyle(const QString& oldname, const QString& newname) { m_cstyles.insert(oldname, newname); }
- void mapLineStyle(const QString& oldname, const QString& newname) { m_linestyles.insert(oldname, newname); }
- void mapTableStyle(const QString& oldname, const QString& newname) { m_tableStyles.insert(oldname, newname); }
- void mapCellStyle(const QString& oldname, const QString& newname) { m_cellStyles.insert(oldname, newname); }
-
- void mapFonts(const QMap<QString,QString>& newnames) { m_fonts = newnames; }
- void mapPatterns(const QMap<QString,QString>& newnames) { m_patterns = newnames; }
- void mapFontfeatures(const QMap<QString,QString>& newnames) { m_fontfeatures = newnames; }
- void mapColors(const QMap<QString,QString>& newnames) { m_colors = newnames; }
- void mapGradients(const QMap<QString,QString>& newnames) { m_gradients = newnames; }
- void mapStyles(const QMap<QString,QString>& newnames) { m_pstyles = newnames; }
- void mapCharStyles(const QMap<QString,QString>& newnames) { m_cstyles = newnames; }
- void mapLineStyles(const QMap<QString,QString>& newnames) { m_linestyles = newnames; }
- void mapTableStyles(const QMap<QString,QString>& newnames) { m_tableStyles = newnames; }
- void mapCellStyles(const QMap<QString,QString>& newnames) { m_cellStyles = newnames; }
-
- const QMap<QString, QString>& fonts() { return m_fonts; }
- const QMap<QString, QString>& fontfeatures() { return m_fontfeatures; }
- const QMap<QString, QString>& patterns() { return m_patterns; }
- const QMap<QString, QString>& colors() { return m_colors; }
- const QMap<QString, QString>& gradients() { return m_gradients; }
- const QMap<QString, QString>& styles() { return m_pstyles; }
- const QMap<QString, QString>& charStyles() { return m_cstyles; }
- const QMap<QString, QString>& lineStyles() { return m_linestyles; }
- const QMap<QString, QString>& tableStyles() { return m_tableStyles; }
- const QMap<QString, QString>& cellStyles() { return m_cellStyles; }
-
- QList<QString> fontNames() const { return m_fonts.keys(); }
- QList<QString> patternNames() const { return m_patterns.keys(); }
- QList<QString> fontfeaturesNames() const { return m_fontfeatures.keys(); }
- QList<QString> colorNames() const { return m_colors.keys(); }
- QList<QString> gradientNames() const { return m_gradients.keys(); }
- QList<QString> styleNames() const { return m_pstyles.keys(); }
- QList<QString> charStyleNames() const { return m_cstyles.keys(); }
- QList<QString> lineStyleNames() const { return m_linestyles.keys(); }
- QList<QString> tableStyleNames() const { return m_tableStyles.keys(); }
- QList<QString> cellStyleNames() const { return m_cellStyles.keys(); }
+ public:
+ ResourceCollection() {}
+ void collectFont(const QString& name) { if (!name.isEmpty()) m_fonts.insert(name,name); }
+ void collectFontfeatures(const QString& name) { if (!name.isEmpty()) m_fontfeatures.insert(name,name); }
+ void collectPattern(const QString& name) { if (!name.isEmpty()) m_patterns.insert(name,name); }
+ void collectColor(const QString& name) { if (!name.isEmpty()) m_colors.insert(name,name); }
+ void collectGradient(const QString& name) { if (!name.isEmpty()) m_gradients.insert(name,name); }
+ void collectStyle(const QString& name) { if (!name.isEmpty()) m_pstyles.insert(name,name); }
+ void collectCharStyle(const QString& name) { if (!name.isEmpty()) m_cstyles.insert(name,name); }
+ void collectLineStyle(const QString& name) { if (!name.isEmpty()) m_linestyles.insert(name,name); }
+ void collectTableStyle(const QString& name) { if (!name.isEmpty()) m_tableStyles.insert(name,name); }
+ void collectCellStyle(const QString& name) { if (!name.isEmpty()) m_cellStyles.insert(name,name); }
- // modifies newNames so that forall x in both newNames.key() and in existingNames, newNames[x] will map to a new unique name
- static void makeUnique(QMap<QString,QString>& newNames, const QList<QString> existingNames);
+ void mapFont(const QString& oldname, const QString& newname) { m_fonts.insert(oldname, newname); }
+ void mapPattern(const QString& oldname, const QString& newname) { m_patterns.insert(oldname, newname); }
+ void mapFontfeatures(const QString& oldname, const QString& newname) { m_fontfeatures.insert(oldname, newname); }
+ void mapColor(const QString& oldname, const QString& newname) { m_colors.insert(oldname, newname); }
+ void mapGradients(const QString& oldname, const QString& newname) { m_gradients.insert(oldname, newname); }
+ void mapStyle(const QString& oldname, const QString& newname) { m_pstyles.insert(oldname, newname); }
+ void mapCharStyle(const QString& oldname, const QString& newname) { m_cstyles.insert(oldname, newname); }
+ void mapLineStyle(const QString& oldname, const QString& newname) { m_linestyles.insert(oldname, newname); }
+ void mapTableStyle(const QString& oldname, const QString& newname) { m_tableStyles.insert(oldname, newname); }
+ void mapCellStyle(const QString& oldname, const QString& newname) { m_cellStyles.insert(oldname, newname); }
- void makeNamedResourcesUnique(ResourceCollection& other);
-
- SCFonts* availableFonts;
- ColorList* availableColors;
- QMap<QString, VGradient> *availableGradients;
-private:
- QMap<QString,QString> m_fonts;
- QMap<QString,QString> m_patterns;
- QMap<QString,QString> m_fontfeatures;
- QMap<QString,QString> m_colors;
- QMap<QString,QString> m_gradients;
- QMap<QString,QString> m_pstyles;
- QMap<QString,QString> m_cstyles;
- QMap<QString,QString> m_linestyles;
- QMap<QString,QString> m_tableStyles;
- QMap<QString,QString> m_cellStyles;
+ void mapFonts(const QMap<QString,QString>& newnames) { m_fonts = newnames; }
+ void mapPatterns(const QMap<QString,QString>& newnames) { m_patterns = newnames; }
+ void mapFontfeatures(const QMap<QString,QString>& newnames) { m_fontfeatures = newnames; }
+ void mapColors(const QMap<QString,QString>& newnames) { m_colors = newnames; }
+ void mapGradients(const QMap<QString,QString>& newnames) { m_gradients = newnames; }
+ void mapStyles(const QMap<QString,QString>& newnames) { m_pstyles = newnames; }
+ void mapCharStyles(const QMap<QString,QString>& newnames) { m_cstyles = newnames; }
+ void mapLineStyles(const QMap<QString,QString>& newnames) { m_linestyles = newnames; }
+ void mapTableStyles(const QMap<QString,QString>& newnames) { m_tableStyles = newnames; }
+ void mapCellStyles(const QMap<QString,QString>& newnames) { m_cellStyles = newnames; }
+
+ const QMap<QString, QString>& fonts() { return m_fonts; }
+ const QMap<QString, QString>& fontfeatures() { return m_fontfeatures; }
+ const QMap<QString, QString>& patterns() { return m_patterns; }
+ const QMap<QString, QString>& colors() { return m_colors; }
+ const QMap<QString, QString>& gradients() { return m_gradients; }
+ const QMap<QString, QString>& styles() { return m_pstyles; }
+ const QMap<QString, QString>& charStyles() { return m_cstyles; }
+ const QMap<QString, QString>& lineStyles() { return m_linestyles; }
+ const QMap<QString, QString>& tableStyles() { return m_tableStyles; }
+ const QMap<QString, QString>& cellStyles() { return m_cellStyles; }
+
+ QList<QString> fontNames() const { return m_fonts.keys(); }
+ QList<QString> patternNames() const { return m_patterns.keys(); }
+ QList<QString> fontfeaturesNames() const { return m_fontfeatures.keys(); }
+ QList<QString> colorNames() const { return m_colors.keys(); }
+ QList<QString> gradientNames() const { return m_gradients.keys(); }
+ QList<QString> styleNames() const { return m_pstyles.keys(); }
+ QList<QString> charStyleNames() const { return m_cstyles.keys(); }
+ QList<QString> lineStyleNames() const { return m_linestyles.keys(); }
+ QList<QString> tableStyleNames() const { return m_tableStyles.keys(); }
+ QList<QString> cellStyleNames() const { return m_cellStyles.keys(); }
+
+ // modifies newNames so that forall x in both newNames.key() and in existingNames, newNames[x] will map to a new unique name
+ static void makeUnique(QMap<QString,QString>& newNames, const QList<QString> existingNames);
+
+ void makeNamedResourcesUnique(ResourceCollection& other);
+
+ SCFonts* availableFonts {nullptr};
+ ColorList* availableColors {nullptr};
+ QMap<QString, VGradient> *availableGradients {nullptr};
+ private:
+ QMap<QString,QString> m_fonts;
+ QMap<QString,QString> m_patterns;
+ QMap<QString,QString> m_fontfeatures;
+ QMap<QString,QString> m_colors;
+ QMap<QString,QString> m_gradients;
+ QMap<QString,QString> m_pstyles;
+ QMap<QString,QString> m_cstyles;
+ QMap<QString,QString> m_linestyles;
+ QMap<QString,QString> m_tableStyles;
+ QMap<QString,QString> m_cellStyles;
};
-
#endif
Modified: trunk/Scribus/scribus/scclocale.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scclocale.h
==============================================================================
--- trunk/Scribus/scribus/scclocale.h (original)
+++ trunk/Scribus/scribus/scclocale.h Mon Sep 23 21:57:38 2019
@@ -51,9 +51,9 @@
public:
static inline bool isDigit(ushort ch);
static double toDoubleC(const QChar *&str);
- static double toDoubleC(const QString& str, bool * ok = 0);
+ static double toDoubleC(const QString& str, bool* ok = nullptr);
static double toDoubleC(const QString& str, double defValue);
- static float toFloatC(const QString& str, bool * ok = 0);
+ static float toFloatC(const QString& str, bool* ok = nullptr);
static float toFloatC(const QString& str, float defValue);
static QString toQStringC(double d, int prec = 3);
static double strtod(const char * str, char ** endptr);
Modified: trunk/Scribus/scribus/scdocoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scdocoutput.h
==============================================================================
--- trunk/Scribus/scribus/scdocoutput.h (original)
+++ trunk/Scribus/scribus/scdocoutput.h Mon Sep 23 21:57:38 2019
@@ -18,7 +18,7 @@
class SCRIBUS_API ScDocOutput
{
protected:
- ScDocOutput() {}
+ ScDocOutput() = default;
virtual bool begin(void) { return true; }
virtual void end(void) {}
@@ -26,7 +26,7 @@
virtual ScPageOutput* createPageOutputComponent(int pageIndex) { return nullptr; }
public:
- virtual ~ScDocOutput() {}
+virtual ~ScDocOutput() = default;
virtual bool makeOutput(ScribusDoc* doc, std::vector<int>& pageNumbers);
};
Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp (original)
+++ trunk/Scribus/scribus/scfonts.cpp Mon Sep 23 21:57:38 2019
@@ -878,7 +878,7 @@
t.m_m->forDocument = DocName;
//setBestEncoding(face); //AV
if (m_showFontInfo)
- sDebug(QObject::tr("Font %1 loaded from %2(%3)").arg(t.psName()).arg(filename).arg(faceIndex+1));
+ sDebug(QObject::tr("Font %1 loaded from %2(%3)").arg(t.psName(), filename).arg(faceIndex+1));
/*
//debug
@@ -1240,7 +1240,7 @@
writeFontCache(pf);
}
-void SCFonts::addRejectedFont(QString fontPath, QString message)
+void SCFonts::addRejectedFont(const QString& fontPath, const QString& message)
{
rejectedFonts.insert(fontPath, message);
}
Modified: trunk/Scribus/scribus/scfonts.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scfonts.h
==============================================================================
--- trunk/Scribus/scribus/scfonts.h (original)
+++ trunk/Scribus/scribus/scfonts.h Mon Sep 23 21:57:38 2019
@@ -65,7 +65,7 @@
void writeFontCache(const QString& pf);
void addPath(QString p);
bool addScalableFont(const QString& filename, FT_Library &library, const QString& DocName);
- void addRejectedFont(QString fontPath, QString message);
+ void addRejectedFont(const QString& fontPath, const QString& message);
void addUserPath(const QString& pf);
#ifdef HAVE_FONTCONFIG
void addFontconfigFonts();
Modified: trunk/Scribus/scribus/scgtplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scgtplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/scgtplugin.cpp (original)
+++ trunk/Scribus/scribus/scgtplugin.cpp Mon Sep 23 21:57:38 2019
@@ -20,35 +20,33 @@
/***************************************************************************************/
/***************************************************************************************/
-ScGTPluginManager* ScGTPluginManager::instance_ = nullptr; // init static variables
+ScGTPluginManager* ScGTPluginManager::m_instance = nullptr; // init static variables
-ScGTPluginManager::ScGTPluginManager()
-{
-}
+ScGTPluginManager::ScGTPluginManager() = default;
ScGTPluginManager* ScGTPluginManager::instance()
{
- if (!ScGTPluginManager::instance_)
- instance_ = new ScGTPluginManager();
+ if (!ScGTPluginManager::m_instance)
+ m_instance = new ScGTPluginManager();
- return instance_;
+ return m_instance;
}
void ScGTPluginManager::deleteInstance()
{
- delete instance_;
- instance_ = nullptr;
+ delete m_instance;
+ m_instance = nullptr;
}
void ScGTPluginManager::registerGTPlugin(ScGTPlugin *plugin)
{
if (plugin)
- plugins_.append(plugin);
+ m_plugins.append(plugin);
}
void ScGTPluginManager::unRegisterGTPlugin(ScGTPlugin *plugin)
{
- plugins_.removeAll(plugin);
+ m_plugins.removeAll(plugin);
}
void ScGTPluginManager::run()
@@ -64,14 +62,14 @@
QString ScGTPluginManager::fileFilter()
{
- QString filters = "";
+ QString filters;
QString allSupported = QObject::tr("All Supported Formats") + " (";
- for (int i = 0; i < plugins_.count(); ++i)
+ for (int i = 0; i < m_plugins.count(); ++i)
{
- if (plugins_.at(i)->fileExtensions().count() != 0)
+ if (m_plugins.at(i)->fileExtensions().count() != 0)
{
- filters += plugins_.at(i)->fileFormatName() + " (";
- QStringList fileExtensions = plugins_.at(i)->fileExtensions();
+ filters += m_plugins.at(i)->fileFormatName() + " (";
+ QStringList fileExtensions = m_plugins.at(i)->fileExtensions();
for (int j = 0; j < fileExtensions.count(); ++j)
{
filters += "*." + fileExtensions[j] + " ";
@@ -94,16 +92,13 @@
}
-ScGTPluginManager::~ScGTPluginManager()
-{
-
-}
+ScGTPluginManager::~ScGTPluginManager() = default;
/***************************************************************************************/
/***************************************************************************************/
-ScGTFileDialog::ScGTFileDialog(const QString & dirName,
- const QString & filters,
+ScGTFileDialog::ScGTFileDialog(const QString& dirName,
+ const QString& filters,
QWidget * parent, const char * name)
: CustomFDialog(parent, dirName, tr("Select a file to import"), filters)
{
@@ -112,39 +107,39 @@
bool ScGTFileDialog::showOptions() const
{
- return showOptionsBox_->isChecked();
+ return m_showOptionsBox->isChecked();
}
bool ScGTFileDialog::append() const
{
- return appendBox_->isChecked();
+ return m_appendBox->isChecked();
}
void ScGTFileDialog::customize()
{
- diaExtension_ = new QWidget(this);
- diaExtension_->setObjectName("diaExtension_");
+ m_diaExtension = new QWidget(this);
+ m_diaExtension->setObjectName("diaExtension_");
- appendBox_ = new QCheckBox( tr("Append"), diaExtension_);
- appendBox_->setObjectName("appendBox_");
- showOptionsBox_ = new QCheckBox( tr("Show options"), diaExtension_);
- showOptionsBox_->setObjectName("showOptionsBox_");
+ m_appendBox = new QCheckBox( tr("Append"), m_diaExtension);
+ m_appendBox->setObjectName("appendBox_");
+ m_showOptionsBox = new QCheckBox( tr("Show options"), m_diaExtension);
+ m_showOptionsBox->setObjectName("showOptionsBox_");
QHBoxLayout *layout = new QHBoxLayout;
layout->setSpacing(5);
- layout->addWidget(appendBox_);
- layout->addWidget(showOptionsBox_);
+ layout->addWidget(m_appendBox);
+ layout->addWidget(m_showOptionsBox);
- diaExtension_->setLayout(layout);
+ m_diaExtension->setLayout(layout);
- addWidgets(diaExtension_);
+ addWidgets(m_diaExtension);
}
ScGTFileDialog::~ScGTFileDialog()
{
- delete showOptionsBox_;
- delete appendBox_;
- delete diaExtension_;
+ delete m_showOptionsBox;
+ delete m_appendBox;
+ delete m_diaExtension;
}
/***************************************************************************************/
Modified: trunk/Scribus/scribus/scgtplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scgtplugin.h
==============================================================================
--- trunk/Scribus/scribus/scgtplugin.h (original)
+++ trunk/Scribus/scribus/scgtplugin.h Mon Sep 23 21:57:38 2019
@@ -30,7 +30,7 @@
Q_OBJECT
public:
ScGTPlugin();
- ~ScGTPlugin() {};
+ ~ScGTPlugin() = default;
/**
@brief Returns the file format's name that this plugin can import or QString()
@@ -57,7 +57,7 @@
@param filename name of the file that is wanted to be imported
@param encoding encoding as selected by a user in the import file dialog
*/
- virtual void run(const QString &filename, const QString &encoding = QString()) {};
+ virtual void run(const QString&filename, const QString&encoding = QString()) {};
/**
@brief Run the plugin and do the magic with the <code>text</code> and
@@ -66,7 +66,7 @@
This function is ment to be overriden by all text and style handler plugins.
@param text text to work with
*/
- virtual void run(const QString &text /*, insert style stuff here */) {};
+ virtual void run(const QString&text /*, insert style stuff here */) {};
};
@@ -94,9 +94,9 @@
void run();
private:
- static ScGTPluginManager *instance_;
+ static ScGTPluginManager *m_instance;
- QList<ScGTPlugin*> plugins_;
+ QList<ScGTPlugin*> m_plugins;
ScGTPluginManager();
~ScGTPluginManager();
@@ -113,18 +113,17 @@
class SCRIBUS_API ScGTFileDialog : public CustomFDialog {
Q_OBJECT
public:
- ScGTFileDialog(const QString & dirName,
- const QString & filters,
- QWidget * parent = 0, const char * name = 0);
+ ScGTFileDialog(const QString& dirName, const QString& filters,
+ QWidget* parent = nullptr, const char* name = nullptr);
~ScGTFileDialog();
bool showOptions() const;
bool append() const;
private:
- QWidget *diaExtension_;
- QCheckBox *showOptionsBox_;
- QCheckBox *appendBox_;
+ QWidget *m_diaExtension {nullptr};
+ QCheckBox *m_showOptionsBox {nullptr};
+ QCheckBox *m_appendBox {nullptr};
void customize();
};
Modified: trunk/Scribus/scribus/scguardedptr.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scguardedptr.h
==============================================================================
--- trunk/Scribus/scribus/scguardedptr.h (original)
+++ trunk/Scribus/scribus/scguardedptr.h Mon Sep 23 21:57:38 2019
@@ -8,7 +8,7 @@
#define SCGUARDEDPTR_H
#include "scribusapi.h"
-#include "assert.h"
+#include "cassert"
/*
A replacement for QPointer
Does not rely on QObject, and provides faster destructor
@@ -22,7 +22,7 @@
int refs;
T* pointer;
- ScGuardedPtrData(void) { pointer = 0; refs = 0; }
+ ScGuardedPtrData(void) { pointer = nullptr; refs = 0; }
ScGuardedPtrData(T* ptr) { pointer = ptr; refs = 0; }
};
@@ -30,9 +30,9 @@
class ScGuardedPtr
{
protected:
- ScGuardedPtrData<T> *data;
+ScGuardedPtrData<T>* data {nullptr};
public:
- ScGuardedPtr(void);
+ ScGuardedPtr();
ScGuardedPtr(T* ptr);
ScGuardedPtr(const ScGuardedPtr& gPtr);
~ScGuardedPtr();
@@ -41,13 +41,13 @@
bool operator==( const ScGuardedPtr<T> &p ) const { return (T*)(*this) == (T*) p;}
bool operator!= ( const ScGuardedPtr<T>& p ) const { return !( *this == p ); }
- bool isNull(void) const;
+ bool isNull() const;
- T* operator->() const { return (T*)(data ? data->pointer : 0); }
+ T* operator->() const { return (T*)(data ? data->pointer : nullptr); }
T& operator*() const { return *((T*)(data ? data->pointer : 0)); }
- operator T*() const { return (T*)(data ? data->pointer : 0); }
+ operator T*() const { return (T*)(data ? data->pointer : nullptr); }
- int refCount(void) const;
+ int refCount() const;
void deref(void);
};
@@ -63,11 +63,11 @@
bool operator==( const ScGuardedObject<T> &p ) const { return (T*)(*this) == (T*) p;}
bool operator!= ( const ScGuardedObject<T>& p ) const { return !( *this == p ); }
- void nullify(void);
+ void nullify();
};
template<typename T>
-ScGuardedPtr<T>::ScGuardedPtr(void)
+ScGuardedPtr<T>::ScGuardedPtr()
{
data = new ScGuardedPtrData<T>();
++(data->refs);
@@ -107,15 +107,15 @@
};
template<typename T>
-bool ScGuardedPtr<T>::isNull(void) const
+bool ScGuardedPtr<T>::isNull() const
{
if (data)
- return (data->pointer == 0);
+ return (data->pointer == nullptr);
return true;
};
template<typename T>
-int ScGuardedPtr<T>::refCount(void) const
+int ScGuardedPtr<T>::refCount() const
{
if (data)
return data->refs;
@@ -123,12 +123,12 @@
};
template<typename T>
-void ScGuardedPtr<T>::deref(void)
+void ScGuardedPtr<T>::deref()
{
if (data && --(data->refs) == 0)
{
delete data;
- data = 0;
+ data = nullptr;
}
};
@@ -154,10 +154,10 @@
};
template<typename T>
-void ScGuardedObject<T>::nullify(void)
+void ScGuardedObject<T>::nullify()
{
if (this->data)
- this->data->pointer = 0;
+ this->data->pointer = nullptr;
};
template<typename T>
Modified: trunk/Scribus/scribus/sclayer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/sclayer.cpp
==============================================================================
--- trunk/Scribus/scribus/sclayer.cpp (original)
+++ trunk/Scribus/scribus/sclayer.cpp Mon Sep 23 21:57:38 2019
@@ -478,8 +478,9 @@
void ScLayers::sort()
{
int level = 0;
- ScLayers::Iterator it, itend = end();
- qStableSort(begin(), end());
+ ScLayers::Iterator it;
+ ScLayers::Iterator itend = end();
+ std::stable_sort(begin(), end());
for (it = begin(); it != itend; ++it, ++level)
it->Level = level;
}
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Sep 23 21:57:38 2019
@@ -1433,7 +1433,7 @@
}
else
{
- setStatusBarInfoText( tr("%1 Objects selected, Selection Size = %2 x %3").arg(docSelectionCount).arg(widthTxt).arg(heightTxt));
+ setStatusBarInfoText( tr("%1 Objects selected, Selection Size = %2 x %3").arg(docSelectionCount).arg(widthTxt, heightTxt));
}
}
@@ -4675,7 +4675,7 @@
// Sort items in Z-order
QList<PageItem*> selectedItems = doc->m_Selection->items();
- qStableSort(selectedItems.begin(), selectedItems.end(), compareItemLevel);
+ std::stable_sort(selectedItems.begin(), selectedItems.end(), compareItemLevel);
Selection tempSelection(this, false);
for (int i = 0; i < selectedItems.count(); ++i)
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Mon Sep 23 21:57:38 2019
@@ -585,7 +585,7 @@
printArgLine(ts, ARG_PROFILEINFO_SHORT, ARG_PROFILEINFO, tr("Show location of ICC profile information on console while starting") );
printArgLine(ts, ARG_UPGRADECHECK_SHORT, ARG_UPGRADECHECK, tr("Download a file from the Scribus website and show the latest available version") );
printArgLine(ts, ARG_VERSION_SHORT, ARG_VERSION, tr("Output version information and exit") );
- printArgLine(ts, ARG_PYTHONSCRIPT_SHORT, qPrintable(QString("%1 <%2> [%3] ").arg(ARG_PYTHONSCRIPT).arg(tr("script"), tr("arguments ..."))), tr("Run script in Python [with optional arguments]. This option must be last option used") );
+ printArgLine(ts, ARG_PYTHONSCRIPT_SHORT, qPrintable(QString("%1 <%2> [%3] ").arg(ARG_PYTHONSCRIPT, tr("script"), tr("arguments ..."))), tr("Run script in Python [with optional arguments]. This option must be last option used") );
printArgLine(ts, ARG_NOGUI_SHORT, ARG_NOGUI, tr("Do not start GUI") );
ts << (QString(" %1").arg(CMD_OPTIONS_END,-39)) << tr("Explicit end of command line options"); endl(ts);
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Mon Sep 23 21:57:38 2019
@@ -3377,7 +3377,7 @@
{
if (UndoManager::undoEnabled())
{
- SimpleState *ss = new SimpleState(Um::SetLayerName, QString(Um::FromTo).arg(Layers[i].Name).arg(newName), Um::IDown);
+ SimpleState *ss = new SimpleState(Um::SetLayerName, QString(Um::FromTo).arg(Layers[i].Name, newName), Um::IDown);
ss->set("CHANGE_NAME");
ss->set("ACTIVE", m_ActiveLayer);
ss->set("NEW_NAME", newName);
@@ -5779,7 +5779,6 @@
{
double x, y, width, height;
QRectF canvasRect;
- QRectF pageRect;
MarginStruct pageBleeds;
PageItem *currItem;
ScPage* page;
@@ -8503,7 +8502,7 @@
{
// Remove selected row(s).
QList<int> selectedRows = table->selectedRows().toList();
- qSort(selectedRows.begin(), selectedRows.end(), qGreater<int>());
+ std::sort(selectedRows.begin(), selectedRows.end(), std::greater<int>());
int index = 0;
int numRows = 1;
@@ -8559,7 +8558,7 @@
{
// Remove selected column(s).
QList<int> selectedColumns = table->selectedColumns().toList();
- qSort(selectedColumns.begin(), selectedColumns.end(), qGreater<int>());
+ std::sort(selectedColumns.begin(), selectedColumns.end(), std::greater<int>());
int index = 0;
int numColumns = 1;
@@ -8606,8 +8605,8 @@
QList<int> selectedRows = table->selectedRows().toList();
QList<int> selectedColumns = table->selectedColumns().toList();
- qSort(selectedRows);
- qSort(selectedColumns);
+ std::sort(selectedRows.begin(), selectedRows.end());
+ std::sort(selectedColumns.begin(), selectedColumns.end());
const int row = selectedRows.first();
const int column = selectedColumns.first();
@@ -8736,7 +8735,7 @@
{
// Distribute each contigous range of selected rows.
QList<int> selectedRows = table->selectedRows().toList();
- qSort(selectedRows);
+ std::sort(selectedRows.begin(), selectedRows.end());
int startRow = selectedRows.first();
int endRow = startRow;
for (int i = 0; i < selectedRows.size() - 1; ++i)
@@ -8779,7 +8778,7 @@
{
// Distribute each contigous range of selected columns.
QList<int> selectedColumns = table->selectedColumns().toList();
- qSort(selectedColumns);
+ std::sort(selectedColumns.begin(), selectedColumns.end());
int startColumn = selectedColumns.first();
int endColumn = startColumn;
for (int i = 0; i < selectedColumns.size() - 1; ++i)
@@ -12059,7 +12058,7 @@
}
}
-void ScribusDoc::itemSelection_AlignLeftOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignLeftOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12097,7 +12096,7 @@
}
-void ScribusDoc::itemSelection_AlignLeftIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignLeftIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12135,7 +12134,7 @@
}
-void ScribusDoc::itemSelection_AlignCenterHor(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignCenterHor(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12188,7 +12187,7 @@
}
-void ScribusDoc::itemSelection_AlignRightIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignRightIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12228,7 +12227,7 @@
}
-void ScribusDoc::itemSelection_AlignRightOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignRightOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12268,7 +12267,7 @@
}
-void ScribusDoc::itemSelection_AlignTopOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignTopOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12306,12 +12305,13 @@
}
-void ScribusDoc::itemSelection_AlignTopIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignTopIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
int alignObjectsCount = AObjects.count();
- int loopStart = 0, loopEnd = alignObjectsCount - 1;
+ int loopStart = 0;
+ int loopEnd = alignObjectsCount - 1;
double newY = std::numeric_limits<double>::max();
switch ( currAlignTo )
{
@@ -12344,7 +12344,7 @@
}
-void ScribusDoc::itemSelection_AlignCenterVer(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignCenterVer(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12397,7 +12397,7 @@
}
-void ScribusDoc::itemSelection_AlignBottomIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignBottomIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -12437,7 +12437,7 @@
}
-void ScribusDoc::itemSelection_AlignBottomOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition)
+void ScribusDoc::itemSelection_AlignBottomOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition)
{
if (!startAlign())
return;
@@ -13478,7 +13478,7 @@
view()->updatesOn(false);
QList<PageItem*> selectedItems = m_Selection->items();
- qStableSort(selectedItems.begin(), selectedItems.end(), compareItemLevel);
+ std::stable_sort(selectedItems.begin(), selectedItems.end(), compareItemLevel);
Selection selection(this, false);
for (int i = 0; i < selectedItems.count(); ++i)
@@ -15060,7 +15060,7 @@
if (UndoManager::undoEnabled())
activeTransaction = m_undoManager->beginTransaction(Um::Selection, Um::IGroup, Um::Group, "", Um::IGroup);
QList<PageItem*> selectedItems = itemSelection->items();
- qStableSort(selectedItems.begin(), selectedItems.end(), compareItemLevel);
+ std::stable_sort(selectedItems.begin(), selectedItems.end(), compareItemLevel);
int selectedItemCount = selectedItems.count();
QString tooltip = Um::ItemsInvolved + "\n";
if (selectedItemCount > Um::ItemsInvolvedLimit)
@@ -18036,7 +18036,7 @@
NotesStyle* currNS = nF->notesStyle();
if (currNS->isAutoNotesHeight() || currNS->isAutoNotesWidth())
nF->invalidateLayout(false);
- qSort(nList.begin(), nList.end(), ascendingSort);
+ std::sort(nList.begin(), nList.end(), ascendingSort);
if (nList == m_docNotesInFrameMap.value(nF))
return;
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Mon Sep 23 21:57:38 2019
@@ -1507,20 +1507,20 @@
void itemSelection_SetImageScale(double x, double y, Selection* customSelection = nullptr);
void itemSelection_SetImageScaleAndOffset(double ox, double oy, double sx, double sy, Selection* customSelection = nullptr);
void itemSelection_SetImageRotation(double rot, Selection* customSelection = nullptr);
- void itemSelection_AlignItemLeft(int i, double newX, AlignMethod how);
- void itemSelection_AlignItemRight(int i, double newX, AlignMethod how);
- void itemSelection_AlignItemTop(int i, double newY, AlignMethod how);
- void itemSelection_AlignItemBottom(int i, double newY, AlignMethod how);
- void itemSelection_AlignLeftOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignRightOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignBottomIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignRightIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignBottomOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignCenterHor(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignLeftIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignCenterVer(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignTopOut(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
- void itemSelection_AlignTopIn(AlignTo currAlignTo, AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignItemLeft(int i, double newX, ScribusDoc::AlignMethod how);
+ void itemSelection_AlignItemRight(int i, double newX, ScribusDoc::AlignMethod how);
+ void itemSelection_AlignItemTop(int i, double newY, ScribusDoc::AlignMethod how);
+ void itemSelection_AlignItemBottom(int i, double newY, ScribusDoc::AlignMethod how);
+ void itemSelection_AlignLeftOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignRightOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignBottomIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignRightIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignBottomOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignCenterHor(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignLeftIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignCenterVer(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignTopOut(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
+ void itemSelection_AlignTopIn(ScribusDoc::AlignTo currAlignTo, ScribusDoc::AlignMethod currAlignMethod, double guidePosition);
void sendItemSelectionToBack();
void bringItemSelectionToFront();
Modified: trunk/Scribus/scribus/tableborder.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/tableborder.cpp
==============================================================================
--- trunk/Scribus/scribus/tableborder.cpp (original)
+++ trunk/Scribus/scribus/tableborder.cpp Mon Sep 23 21:57:38 2019
@@ -10,7 +10,7 @@
#include <QList>
#include <QString>
#include <QStringList>
-#include <QtAlgorithms>
+#include <QtAlgorithms>S
#include "commonstrings.h"
Modified: trunk/Scribus/scribus/ui/colorlistmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/colorlistmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorlistmodel.cpp (original)
+++ trunk/Scribus/scribus/ui/colorlistmodel.cpp Mon Sep 23 21:57:38 2019
@@ -187,9 +187,9 @@
if (m_sortRule != SortByName)
{
if (m_sortRule == SortByValues)
- qSort(m_colors.begin(), m_colors.end(), compareColorValues);
+ std::sort(m_colors.begin(), m_colors.end(), compareColorValues);
else if (m_sortRule == SortByType)
- qSort(m_colors.begin(), m_colors.end(), compareColorTypes);
+ std::sort(m_colors.begin(), m_colors.end(), compareColorTypes);
}
endResetModel();
@@ -214,11 +214,11 @@
m_sortRule = sortRule;
if (m_sortRule == SortByValues)
- qSort(m_colors.begin(), m_colors.end(), compareColorValues);
+ std::sort(m_colors.begin(), m_colors.end(), compareColorValues);
else if (m_sortRule == SortByType)
- qSort(m_colors.begin(), m_colors.end(), compareColorTypes);
+ std::sort(m_colors.begin(), m_colors.end(), compareColorTypes);
else
- qSort(m_colors.begin(), m_colors.end(), compareColorNames);
+ std::sort(m_colors.begin(), m_colors.end(), compareColorNames);
endResetModel();
}
Modified: trunk/Scribus/scribus/ui/colorsandfills.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/colorsandfills.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorsandfills.cpp (original)
+++ trunk/Scribus/scribus/ui/colorsandfills.cpp Mon Sep 23 21:57:38 2019
@@ -179,13 +179,13 @@
QTreeWidgetItem* ColorsAndFillsDialog::updatePatternList(const QString& addedName)
{
QList<QTreeWidgetItem*> lg = patternItems->takeChildren();
- for (int a = 0; a < lg.count(); a++)
- {
- delete lg[a];
+ for (int i = 0; i < lg.count(); i++)
+ {
+ delete lg[i];
}
QTreeWidgetItem* ret = nullptr;
QStringList patK = dialogPatterns.keys();
- qSort(patK);
+ patK.sort();
for (int a = 0; a < patK.count(); a++)
{
ScPattern sp = dialogPatterns.value(patK[a]);
@@ -213,13 +213,13 @@
QTreeWidgetItem* ColorsAndFillsDialog::updateGradientList(const QString& addedName)
{
QList<QTreeWidgetItem*> lg = gradientItems->takeChildren();
- for (int a = 0; a < lg.count(); a++)
- {
- delete lg[a];
+ for (int i = 0; i < lg.count(); i++)
+ {
+ delete lg[i];
}
QTreeWidgetItem* ret = nullptr;
QStringList patK = dialogGradients.keys();
- qSort(patK);
+ patK.sort();
for (int a = 0; a < patK.count(); a++)
{
VGradient gr = dialogGradients.value(patK[a]);
@@ -1184,7 +1184,7 @@
imgFormats.append("eps");
imgFormats.append("epsi");
imgFormats.append("ps");
- qSort(formats);
+ formats.sort();
allFormats += formats.join(";;");
PrefsContext* dirs = PrefsManager::instance().prefsFile->getContext("dirs");
QString wdir = dirs->get("patterns", ".");
Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Mon Sep 23 21:57:38 2019
@@ -703,10 +703,10 @@
namedGradientStroke->setIconSize(QSize(48, 12));
namedGradientStroke->addItem( tr("Custom"));
QStringList patK = gradientList->keys();
- qSort(patK);
- for (int a = 0; a < patK.count(); a++)
- {
- VGradient gr = gradientList->value(patK[a]);
+ patK.sort();
+ for (int i = 0; i < patK.count(); i++)
+ {
+ VGradient gr = gradientList->value(patK[i]);
QImage pixm(48, 12, QImage::Format_ARGB32_Premultiplied);
QPainter pb;
QBrush b(QColor(205,205,205), IconManager::instance().loadPixmap("testfill.png"));
@@ -723,8 +723,8 @@
delete p;
QPixmap pm;
pm = QPixmap::fromImage(pixm);
- namedGradient->addItem(pm, patK[a]);
- namedGradientStroke->addItem(pm, patK[a]);
+ namedGradient->addItem(pm, patK[i]);
+ namedGradientStroke->addItem(pm, patK[i]);
}
namedGradient->blockSignals(sigBlocked1);
namedGradientStroke->blockSignals(sigBlocked2);
@@ -824,7 +824,7 @@
patternBoxStroke->clear();
patternBoxStroke->setIconSize(QSize(48, 48));
QStringList patK = patternList->keys();
- qSort(patK);
+ patK.sort();
for (int a = 0; a < patK.count(); a++)
{
ScPattern sp = patternList->value(patK[a]);
Modified: trunk/Scribus/scribus/ui/gradientpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/gradientpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradientpreview.cpp (original)
+++ trunk/Scribus/scribus/ui/gradientpreview.cpp Mon Sep 23 21:57:38 2019
@@ -21,6 +21,7 @@
* *
***************************************************************************/
+#include <algorithm>
#include <QApplication>
#include <QCursor>
#include <QEvent>
@@ -274,7 +275,7 @@
StopM[ActStop] = m->x();
QList<VColorStop*> cstops = fill_gradient.colorStops();
cstops.at(ActStop)->rampPoint = newStop;
- qSort(cstops.begin(), cstops.end());
+ std::sort(cstops.begin(), cstops.end());
onlyselect = false;
repaint();
}
Modified: trunk/Scribus/scribus/ui/missing.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/missing.h
==============================================================================
--- trunk/Scribus/scribus/ui/missing.h (original)
+++ trunk/Scribus/scribus/ui/missing.h Mon Sep 23 21:57:38 2019
@@ -24,7 +24,7 @@
public:
MissingFont(QWidget* parent, const QString& fon, ScribusDoc* doc);
- ~MissingFont() {};
+ ~MissingFont() = default;
const QString getReplacementFont();
Modified: trunk/Scribus/scribus/ui/modetoolbar.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/modetoolbar.h
==============================================================================
--- trunk/Scribus/scribus/ui/modetoolbar.h (original)
+++ trunk/Scribus/scribus/ui/modetoolbar.h Mon Sep 23 21:57:38 2019
@@ -55,7 +55,7 @@
ModeToolBar(ScribusMainWindow* parent);
~ModeToolBar();
- virtual void changeEvent(QEvent *e);
+ void changeEvent(QEvent *e) override;
void setDoc(ScribusDoc* doc);
int SubMode;
int ValCount;
Modified: trunk/Scribus/scribus/ui/movepage.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/movepage.h
==============================================================================
--- trunk/Scribus/scribus/ui/movepage.h (original)
+++ trunk/Scribus/scribus/ui/movepage.h Mon Sep 23 21:57:38 2019
@@ -25,7 +25,7 @@
public:
MovePages( QWidget* parent, int currentPage, int maxPages, bool moving );
- ~MovePages() {};
+ ~MovePages() = default;
const int getFromPage();
const int getToPage();
Modified: trunk/Scribus/scribus/ui/multipleduplicate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/multipleduplicate.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/multipleduplicate.cpp (original)
+++ trunk/Scribus/scribus/ui/multipleduplicate.cpp Mon Sep 23 21:57:38 2019
@@ -112,7 +112,7 @@
void MultipleDuplicate::createPageNumberRange()
{
- if (m_Doc!=0)
+ if (m_Doc != nullptr)
{
CreateRange cr(lineEditPageRange->text(), m_Doc->Pages->count(), this);
if (cr.exec())
@@ -123,5 +123,5 @@
return;
}
}
- lineEditPageRange->setText(QString::null);
+ lineEditPageRange->clear();
}
Modified: trunk/Scribus/scribus/ui/multiprogressdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/multiprogressdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/multiprogressdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/multiprogressdialog.cpp Mon Sep 23 21:57:38 2019
@@ -39,11 +39,6 @@
buttonCancel->setText(cancelButtonText);
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(emitCancel()));
}
-
-MultiProgressDialog::~MultiProgressDialog()
-{
-}
-
void MultiProgressDialog::emitCancel()
{
emit canceled();
Modified: trunk/Scribus/scribus/ui/multiprogressdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/multiprogressdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/multiprogressdialog.h (original)
+++ trunk/Scribus/scribus/ui/multiprogressdialog.h Mon Sep 23 21:57:38 2019
@@ -46,7 +46,7 @@
Q_OBJECT
public:
- MultiProgressDialog(QWidget* parent=0);
+ MultiProgressDialog(QWidget* parent=nullptr);
/**
* Create a multi progress bar dialog for long operations with multiple steps. The dialog includes
* one standard progress bar, typically for the overall progress and others may be added easily.
@@ -55,8 +55,8 @@
* @param parent Parent widget for the dialog, commonly ScribusMainWindow
* @param f Qt GUI flags
*/
- MultiProgressDialog(const QString& titleText, const QString & cancelButtonText, QWidget* parent=0);
- ~MultiProgressDialog();
+ MultiProgressDialog(const QString& titleText, const QString& cancelButtonText, QWidget* parent=nullptr);
+ ~MultiProgressDialog() = default;
/**
* Remove all progress bars other than the main one
@@ -84,34 +84,34 @@
* @param barName
* @return progress for specified user bar
*/
- int progress(const QString &barName) const;
+ int progress(const QString& barName) const;
/**
* Set a new label for a user defined progress bar
* @param barName Progress bar name
* @param newLabel New label
* @return Success
*/
- bool setLabel(const QString &barName, const QString & newLabel);
+ bool setLabel(const QString& barName, const QString& newLabel);
/**
* Sets a user defined progress bar to a busy bar
* @param barName
* @return Success
*/
- bool setBusyIndicator(const QString &barName);
+ bool setBusyIndicator(const QString& barName);
/**
* Set the total steps for a user defined progress bar
* @param barName
* @param totalSteps
* @return Success
*/
- bool setTotalSteps(const QString &barName, int totalSteps);
+ bool setTotalSteps(const QString& barName, int totalSteps);
/**
* Set the progress for a user defined progress bar
* @param barName
* @param progress
* @return
*/
- bool setProgress(const QString &barName, int progress);
+ bool setProgress(const QString& barName, int progress);
/**
* Set the prgress and total steps for a user defined progress bar
* @param barName
@@ -119,7 +119,7 @@
* @param totalSteps
* @return
*/
- bool setProgress(const QString &barName, int progress, int totalSteps);
+ bool setProgress(const QString& barName, int progress, int totalSteps);
/**
* Set the overall total steps for the dialog
* @param totalSteps
@@ -144,12 +144,12 @@
* @param totalSteps
* @return
*/
- bool setupBar(const QString &barName, const QString &barText, int progress, int totalSteps);
+ bool setupBar(const QString&barName, const QString&barText, int progress, int totalSteps);
/**
* Set the cancel button text
* @param cancelButtonText
*/
- void setCancelButtonText(const QString & cancelButtonText);
+ void setCancelButtonText(const QString& cancelButtonText);
signals:
void canceled();
Modified: trunk/Scribus/scribus/ui/newfile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/newfile.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newfile.cpp (original)
+++ trunk/Scribus/scribus/ui/newfile.cpp Mon Sep 23 21:57:38 2019
@@ -45,9 +45,8 @@
#include "units.h"
#include "iconmanager.h"
-PageLayoutsWidget::PageLayoutsWidget(QWidget* parent) : QListWidget(parent),
- maxX(0),
- maxY(0)
+PageLayoutsWidget::PageLayoutsWidget(QWidget* parent) :
+ QListWidget(parent)
{
setDragEnabled(false);
setViewMode(QListView::IconMode);
Modified: trunk/Scribus/scribus/ui/newfile.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/newfile.h
==============================================================================
--- trunk/Scribus/scribus/ui/newfile.h (original)
+++ trunk/Scribus/scribus/ui/newfile.h Mon Sep 23 21:57:38 2019
@@ -42,11 +42,11 @@
public:
PageLayoutsWidget(QWidget* parent);
- ~PageLayoutsWidget() {}
+ ~PageLayoutsWidget() = default;
void arrangeIcons();
- QSize minimumSizeHint() const;
- int maxX;
- int maxY;
+ QSize minimumSizeHint() const override;
+ int maxX {0};
+ int maxY {0};
};
@@ -65,7 +65,7 @@
} ActionSelected;
NewDoc( QWidget* parent, const QStringList& recentDocs, bool startUp = false, const QString& lang = "");
- ~NewDoc() {}
+ ~NewDoc() = default;
void createNewDocPage();
void createNewFromTempPage();
void createOpenDocPage();
@@ -108,24 +108,24 @@
QPushButton* OKButton;
QPushButton* CancelB;
- bool onStartup(void) const { return m_onStartup;}
- int tabSelected(void) const { return m_tabSelected;}
- QString selectedFile(void) const { return m_selectedFile; }
+ bool onStartup() const { return m_onStartup;}
+ int tabSelected() const { return m_tabSelected;}
+ QString selectedFile() const { return m_selectedFile; }
- int unitIndex(void) const { return m_unitIndex;}
- QString unitSuffix(void) const { return m_unitSuffix;}
- double unitRatio(void) const { return m_unitRatio; }
+ int unitIndex() const { return m_unitIndex;}
+ QString unitSuffix() const { return m_unitSuffix;}
+ double unitRatio() const { return m_unitRatio; }
- int orientation(void) const { return m_orientation;}
- int precision(void) const { return m_precision;}
- int choosenLayout(void) const { return m_choosenLayout;}
- double pageWidth(void) const { return m_pageWidth;}
- double pageHeight(void) const { return m_pageHeight;}
- double distance(void) const { return m_distance;}
- double bleedBottom(void) const { return m_bleedBottom;}
- double bleedTop(void) const { return m_bleedTop;}
- double bleedLeft(void) const { return m_bleedLeft;}
- double bleedRight(void) const { return m_bleedRight;}
+ int orientation() const { return m_orientation;}
+ int precision() const { return m_precision;}
+ int choosenLayout() const { return m_choosenLayout;}
+ double pageWidth() const { return m_pageWidth;}
+ double pageHeight() const { return m_pageHeight;}
+ double distance() const { return m_distance;}
+ double bleedBottom() const { return m_bleedBottom;}
+ double bleedTop() const { return m_bleedTop;}
+ double bleedLeft() const { return m_bleedLeft;}
+ double bleedRight() const { return m_bleedRight;}
public slots:
void setHeight(double v);
Modified: trunk/Scribus/scribus/ui/newmarginwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/newmarginwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newmarginwidget.cpp (original)
+++ trunk/Scribus/scribus/ui/newmarginwidget.cpp Mon Sep 23 21:57:38 2019
@@ -12,23 +12,9 @@
#include "ui/useprintermarginsdialog.h"
NewMarginWidget::NewMarginWidget(QWidget* parent)
- : QWidget(parent),
- m_savedPresetItem(PresetLayout::none),
- m_facingPages(false),
- m_flags(MarginWidgetFlags)
+ : QWidget(parent)
{
setupUi(this);
-
- m_unitIndex = 0;
- m_unitRatio = 1.0;
-
- m_pageWidth = 0;
- m_pageHeight = 0;
- m_pageType = 0;
-}
-
-NewMarginWidget::~NewMarginWidget()
-{
}
void NewMarginWidget::setup(const MarginStruct& margs, int layoutType, int unitIndex, int flags)
Modified: trunk/Scribus/scribus/ui/newmarginwidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/newmarginwidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/newmarginwidget.h (original)
+++ trunk/Scribus/scribus/ui/newmarginwidget.h Mon Sep 23 21:57:38 2019
@@ -17,8 +17,8 @@
Q_OBJECT
public:
- NewMarginWidget(QWidget* parent=0);
- ~NewMarginWidget();
+ NewMarginWidget(QWidget* parent = nullptr);
+ ~NewMarginWidget() = default;
enum SetupFlags
{
@@ -60,15 +60,15 @@
MarginStruct m_marginData;
MarginStruct m_savedMarginData;
- int m_savedPresetItem;
- bool m_facingPages;
- int m_flags;
- int m_unitIndex;
- double m_unitRatio;
QString m_pageSize;
- double m_pageWidth;
- double m_pageHeight;
- int m_pageType;
+ bool m_facingPages {false};
+ double m_pageHeight {0.0};
+ double m_pageWidth {0.0};
+ double m_unitRatio {1.0};
+ int m_flags {MarginWidgetFlags};
+ int m_pageType {0};
+ int m_savedPresetItem {PresetLayout::none};
+ int m_unitIndex {0};
};
#endif // NEWMARGINWIDGET_H
Modified: trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp Mon Sep 23 21:57:38 2019
@@ -158,7 +158,7 @@
int ecol;
if ( !doc.setContent( ts.readAll(), &errorMsg, &eline, &ecol ))
{
- qDebug("%s", QString("Could not open key set file: %1\nError:%2 at line: %3, row: %4").arg(filename).arg(errorMsg).arg(eline).arg(ecol).toLatin1().constData());
+ qDebug("%s", QString("Could not open key set file: %1\nError:%2 at line: %3, row: %4").arg(filename, errorMsg).arg(eline).arg(ecol).toLatin1().constData());
file1.close();
return;
}
@@ -267,7 +267,7 @@
if (!doc.setContent( &file, &errorMsg, &eline, &ecol ))
{
- qDebug("%s", QString("Could not open key set file: %1\nError:%2 at line: %3, row: %4").arg(keySetsDir[fileCounter]).arg(errorMsg).arg(eline).arg(ecol).toLatin1().constData());
+ qDebug("%s", QString("Could not open key set file: %1\nError:%2 at line: %3, row: %4").arg(keySetsDir[fileCounter], errorMsg).arg(eline).arg(ecol).toLatin1().constData());
file.close();
continue;
}
Modified: trunk/Scribus/scribus/ui/prefs_userinterface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/prefs_userinterface.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_userinterface.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_userinterface.cpp Mon Sep 23 21:57:38 2019
@@ -39,7 +39,7 @@
else
languageList << LanguageManager::instance()->getLangFromAbbrev("en_GB");
}
- qSort(languageList.begin(), languageList.end(), localeAwareLessThan);
+ std::sort(languageList.begin(), languageList.end(), localeAwareLessThan);
languageComboBox->addItems(languageList);
// qt styles
Modified: trunk/Scribus/scribus/ui/propertiespalette_table.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/propertiespalette_table.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_table.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_table.cpp Mon Sep 23 21:57:38 2019
@@ -313,7 +313,7 @@
borderLineList->clear();
for (const TableBorderLine& borderLine : m_currentBorder.borderLines())
{
- QString text = QString(" %1%2 %3").arg(borderLine.width()).arg(borderLineWidth->suffix()).arg(CommonStrings::translatePenStyleName(borderLine.style()));
+ QString text = QString(" %1%2 %3").arg(borderLine.width()).arg(borderLineWidth->suffix(), CommonStrings::translatePenStyleName(borderLine.style()));
if (borderLine.color() != CommonStrings::None)
{
QPixmap *icon = getWidePixmap(getColor(borderLine.color(), borderLine.shade()));
@@ -344,7 +344,7 @@
void PropertiesPalette_Table::updateBorderLineListItem()
{
QListWidgetItem* item = borderLineList->currentItem();
- QString text = QString(" %1%2 %3").arg(borderLineWidth->getValue()).arg(borderLineWidth->suffix()).arg(CommonStrings::translatePenStyleName(static_cast<Qt::PenStyle>(borderLineStyle->currentIndex() + 1)));
+ QString text = QString(" %1%2 %3").arg(borderLineWidth->getValue()).arg(borderLineWidth->suffix(), CommonStrings::translatePenStyleName(static_cast<Qt::PenStyle>(borderLineStyle->currentIndex() + 1)));
if (borderLineColor->currentColor() != CommonStrings::None)
{
QPixmap *icon = getWidePixmap(getColor(borderLineColor->currentColor(), borderLineShade->value()));
Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp Mon Sep 23 21:57:38 2019
@@ -121,7 +121,7 @@
tmpList << StyleName(styleName, parentName);
}
}
- qSort(tmpList.begin(), tmpList.end(), sortingQPairOfStrings);
+ std::sort(tmpList.begin(), tmpList.end(), sortingQPairOfStrings);
return tmpList;
}
Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Mon Sep 23 21:57:38 2019
@@ -284,7 +284,7 @@
return;
QStringList patK = m_doc->docPatterns.keys();
- qSort(patK);
+ patK.sort();
for (int a = 0; a < patK.count(); a++)
{
ScPattern sp = m_doc->docPatterns.value(patK[a]);
Modified: trunk/Scribus/scribus/ui/transparencypalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/ui/transparencypalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.cpp (original)
+++ trunk/Scribus/scribus/ui/transparencypalette.cpp Mon Sep 23 21:57:38 2019
@@ -221,7 +221,7 @@
namedGradient->setIconSize(QSize(48, 12));
namedGradient->addItem( tr("Custom"));
QStringList patK = gradientList->keys();
- qSort(patK);
+ patK.sort();
for (int i = 0; i < patK.count(); i++)
{
VGradient gr = gradientList->value(patK[i]);
@@ -447,7 +447,7 @@
patternBox->clear();
patternBox->setIconSize(QSize(48, 48));
QStringList patK = patternList->keys();
- qSort(patK);
+ patK.sort();
for (int a = 0; a < patK.count(); a++)
{
ScPattern sp = patternList->value(patK[a]);
Modified: trunk/Scribus/scribus/upgradechecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/upgradechecker.cpp
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.cpp (original)
+++ trunk/Scribus/scribus/upgradechecker.cpp Mon Sep 23 21:57:38 2019
@@ -149,7 +149,7 @@
if (data.contains("404 not found", Qt::CaseInsensitive))
outputText("<b>"+ tr("File not found on server")+"</b>");
else
- outputText("<b>"+ tr("Could not open version file: %1\nError:%2 at line: %3, row: %4").arg(m_file->fileName()).arg(errorMsg).arg(eline).arg(ecol)+"</b>");
+ outputText("<b>"+ tr("Could not open version file: %1\nError:%2 at line: %3, row: %4").arg(m_file->fileName(), errorMsg).arg(eline).arg(ecol)+"</b>");
return false;
}
Modified: trunk/Scribus/scribus/urllauncher.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/urllauncher.h
==============================================================================
--- trunk/Scribus/scribus/urllauncher.h (original)
+++ trunk/Scribus/scribus/urllauncher.h Mon Sep 23 21:57:38 2019
@@ -19,7 +19,7 @@
class SCRIBUS_API UrlLauncher : public QObject
{
- Q_OBJECT;
+ Q_OBJECT
public:
UrlLauncher(UrlLauncher const&) = delete;
Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp (original)
+++ trunk/Scribus/scribus/util.cpp Mon Sep 23 21:57:38 2019
@@ -522,7 +522,7 @@
QFileInfo fi(defaultName);
defaultName = fi.completeBaseName();
}
- return QString("%1-%2%3.%4").arg(defaultName).arg(QObject::tr("page", "page export")).arg(number, 3, 10, QChar('0')).arg(extension);
+ return QString("%1-%2%3.%4").arg(defaultName, QObject::tr("page", "page export")).arg(number, 3, 10, QChar('0')).arg(extension);
}
const QString getStringFromSequence(NumFormat type, uint position, const QString& asterix)
Modified: trunk/Scribus/scribus/vgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/vgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/vgradient.cpp (original)
+++ trunk/Scribus/scribus/vgradient.cpp Mon Sep 23 21:57:38 2019
@@ -23,8 +23,8 @@
Boston, MA 02110-1301, USA.
*/
+#include <algorithm>
#include <QMutableListIterator>
-#include <QtAlgorithms>
#include "vgradient.h"
@@ -83,7 +83,7 @@
clearStops();
QList<VColorStop*> cs = gradient.colorStops();
- qStableSort(cs.begin(), cs.end(), compareStops);
+ std::stable_sort(cs.begin(), cs.end(), compareStops);
for (int i = 0; i < cs.count(); ++i)
m_colorStops.append( new VColorStop(*cs[i]) );
}
@@ -107,7 +107,7 @@
clearStops();
QList<VColorStop*> cs = gradient.colorStops();
- qStableSort(cs.begin(), cs.end(), compareStops);
+ std::stable_sort(cs.begin(), cs.end(), compareStops);
for (int i = 0; i < cs.count(); ++i)
m_colorStops.append( new VColorStop( *cs[i] ) );
return *this;
Modified: trunk/Scribus/scribus/vgradientex.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23210&path=/trunk/Scribus/scribus/vgradientex.cpp
==============================================================================
--- trunk/Scribus/scribus/vgradientex.cpp (original)
+++ trunk/Scribus/scribus/vgradientex.cpp Mon Sep 23 21:57:38 2019
@@ -23,7 +23,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <QtAlgorithms>
+#include <algorithm>
#include "vgradientex.h"
#include "vgradient.h"
@@ -80,7 +80,7 @@
clearStops();
QList<VColorStopEx*> cs = gradient.colorStops();
- qStableSort( cs.begin(), cs.end(), compareStopsEx);
+ std::stable_sort( cs.begin(), cs.end(), compareStopsEx);
for (int i = 0; i < cs.count(); ++i)
m_colorStops.append( new VColorStopEx(*cs[i]) );
}
@@ -96,7 +96,7 @@
while (!m_colorStops.isEmpty())
delete m_colorStops.takeFirst();
QList<VColorStop*> stops = gradient.colorStops();
- qStableSort( stops.begin(), stops.end(), compareStops);
+ std::stable_sort( stops.begin(), stops.end(), compareStops);
for (int i = 0; i < stops.count(); ++i)
{
VColorStop stop( *stops[i] );
@@ -124,7 +124,7 @@
clearStops();
QList<VColorStopEx*> cs = gradient.colorStops();
- qStableSort( cs.begin(), cs.end(), compareStopsEx);
+ std::stable_sort( cs.begin(), cs.end(), compareStopsEx);
for (int i = 0; i < cs.count(); ++i)
m_colorStops.append( new VColorStopEx( *cs[i] ) );
return *this;
More information about the scribus-commit
mailing list