r23041 by craig - Change initialisation for ScribusDoc, plus more clean up

scribus-commit scribus-commit at lists.scribus.net
Fri Jun 21 22:20:38 UTC 2019


Author: craig
Date: Fri Jun 21 22:20:38 2019
New Revision: 23041

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23041
Log:
Change initialisation for ScribusDoc, plus more clean up

Modified:
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/ui/layers.cpp
    trunk/Scribus/scribus/units.cpp
    trunk/Scribus/scribus/util.cpp
    trunk/Scribus/scribus/util.h

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp	(original)
+++ trunk/Scribus/scribus/actionmanager.cpp	Fri Jun 21 22:20:38 2019
@@ -2543,7 +2543,7 @@
 	(*scrActions)["helpOnlineTutorial1"]->setActionQString("http://wiki.scribus.net/index.php/tutorial"+language);
 }
 
-QKeySequence ActionManager::defaultKey(const QString & actionName)
+QKeySequence ActionManager::defaultKey(const QString& actionName)
 {
 	if (defKeys.contains(actionName))
 		return defKeys.value(actionName);
@@ -2558,6 +2558,6 @@
 		if (defMenuNames.at(i).first == index)
 			return defMenuNames.at(i).second.at(2);
 	}
-	return QString::null;
-}
-
+	return QString();
+}
+

Modified: trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp	(original)
+++ trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp	Fri Jun 21 22:20:38 2019
@@ -17,14 +17,14 @@
 
 ScPlugin* colorwheel_getPlugin()
 {
-	ColorWheelPlugin* plug = new ColorWheelPlugin();
+	auto* plug = new ColorWheelPlugin();
 	Q_CHECK_PTR(plug);
 	return plug;
 }
 
 void colorwheel_freePlugin(ScPlugin* plugin)
 {
-	ColorWheelPlugin* plug = dynamic_cast<ColorWheelPlugin*>(plugin);
+	auto* plug = dynamic_cast<ColorWheelPlugin*>(plugin);
 	Q_ASSERT(plug);
 	delete plug;
 }
@@ -36,7 +36,7 @@
 	languageChange();
 }
 
-ColorWheelPlugin::~ColorWheelPlugin() {};
+ColorWheelPlugin::~ColorWheelPlugin() = default;
 
 void ColorWheelPlugin::languageChange()
 {
@@ -87,7 +87,7 @@
 		currDoc=ScCore->primaryMainWindow()->doc;
 	if (currDoc==nullptr)
 		return false;
-	CWDialog *dlg = new CWDialog(currDoc->scMW(), currDoc, "dlg", true);
+	auto *dlg = new CWDialog(currDoc->scMW(), currDoc, "dlg", true);
 	if (dlg)
 	{
 		dlg->exec();

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Fri Jun 21 22:20:38 2019
@@ -1146,7 +1146,7 @@
 //	scrMenuMgr->addMenuItemString("extrasTestQTQuick2_1", "Extras");
 
 	//Window menu
-	scrMenuMgr->createMenu("Windows", ActionManager::defaultMenuNameEntryTranslated("Windows"), QString::null, true);
+	scrMenuMgr->createMenu("Windows", ActionManager::defaultMenuNameEntryTranslated("Windows"), QString(), true);
 
 	//Help menu
 	scrMenuMgr->createMenu("Help", ActionManager::defaultMenuNameEntryTranslated("Help"));

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h	(original)
+++ trunk/Scribus/scribus/scribus.h	Fri Jun 21 22:20:38 2019
@@ -280,7 +280,7 @@
 	void slotStoryEditor(bool fromTable);
 	void slotCharSelect();
 	void ImageEffects();
-	QString fileCollect(const bool compress = false, const bool withFonts = false, const bool withProfiles = false, const QString& newDirectory=QString::null);
+	QString fileCollect(const bool compress = false, const bool withFonts = false, const bool withProfiles = false, const QString& newDirectory=QString());
 	void AddBookMark(PageItem *ite);
 	void DelBookMark(PageItem *ite);
 	void BookMarkTxT(PageItem *ite);
@@ -320,7 +320,7 @@
 	bool slotFileNew();
 	void newFileFromTemplate();
 	bool slotPageImport();
-	bool loadPage(const QString& fileName, int Nr, bool Mpa, const QString& renamedPageName=QString::null);
+	bool loadPage(const QString& fileName, int Nr, bool Mpa, const QString& renamedPageName=QString());
 	void GotoLa(int l);
 	void slotGetContent();
 	void slotGetContent2(); // kk2006
@@ -392,7 +392,7 @@
     void slotHelpAboutQt();
 	void slotHelpCheckUpdates();
 	void slotRaiseOnlineHelp();
-	void slotOnlineHelp(const QString & jumpToSection=QString::null, const QString & jumpToFile=QString::null);
+	void slotOnlineHelp(const QString & jumpToSection=QString(), const QString & jumpToFile=QString());
 	void slotOnlineHelpClosed();
 	void slotResourceManager();
 	void ToggleTips();
@@ -401,7 +401,7 @@
 	void slotNewPageP(int wo, const QString& templ);
 	void slotNewPageM();
 	void slotNewMasterPage(int w, const QString &);
-	void slotNewPage(int w, const QString& masterPageName=QString::null, bool mov = true);
+	void slotNewPage(int w, const QString& masterPageName=QString(), bool mov = true);
 	void duplicateToMasterPage();
 	/** \brief Loescht die aktuelle Seite */
 	void deletePage();

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Fri Jun 21 22:20:38 2019
@@ -41,7 +41,6 @@
 //#include <qtconcurrentmap.h>
 
 #include "actionmanager.h"
-#include "appmodes.h"
 #include "text/boxes.h"
 #include "canvas.h"
 #include "colorblind.h"
@@ -159,7 +158,7 @@
 		}
 	}
 	
-	void changed(ScPage* pg, bool /*doLayout*/)
+	void changed(ScPage* pg, bool /*doLayout*/) override
 	{
 		QRectF pagebox(pg->xOffset(), pg->yOffset(), pg->width(), pg->height());
 		doc->invalidateRegion(pagebox);
@@ -172,7 +171,7 @@
 		m_docChangeNeeded = true;
 	}
 	
-	void changed(PageItem* it, bool doLayout)
+	void changed(PageItem* it, bool doLayout) override
 	{
 		it->invalidateLayout();
 		if (doLayout)
@@ -203,71 +202,22 @@
 
 
 ScribusDoc::ScribusDoc() : UndoObject( tr("Document")), Observable<ScribusDoc>(nullptr),
-	m_hasGUI(false),
-	m_docFilePermissions(QFileDevice::ReadOwner|QFileDevice::WriteOwner),
 	m_appPrefsData(PrefsManager::instance()->appPrefs),
 	m_docPrefsData(PrefsManager::instance()->appPrefs),
 	m_undoManager(UndoManager::instance()),
-	m_loading(false),
-	m_modified(false),
-	m_ActiveLayer(0),
-	m_rotMode(0),
 	m_automaticTextFrames(false),
-	m_masterPageMode(false),
-	m_symbolEditMode(false),
-	m_inlineEditMode(false),
-	m_ScMW(nullptr),
-	m_View(nullptr),
 	m_guardedObject(this),
-	m_serializer(nullptr),
-	m_tserializer(nullptr),
-	is12doc(false),
-	NrItems(0),
-	First(1), Last(0),
-	viewCount(0), viewID(0),
-	SnapGrid(false),
-	SnapGuides(true),
-	SnapElement(false), GuideLock(false),
 	minCanvasCoordinate(FPoint(0, 0)),
-	rulerXoffset(0.0), rulerYoffset(0.0),
-	Pages(nullptr),
-	Items(nullptr),
 	m_Selection(new Selection(this, true)),
 	PageSp(1), PageSpa(0),
 	FirstPnum(1),
 	PageColors(this, true),
-	appMode(modeNormal),
-	SubMode(-1),
-	ShapeValues(nullptr),
-	ValCount(0),
 	m_documentFileName( tr("Document")+"-"),
 	AllFonts(&m_appPrefsData.fontPrefs.AvailFonts),
-	LastAuto(nullptr), FirstAuto(nullptr),
-	DraggedElem(nullptr),
-	ElemToLink(nullptr),
-	GroupCounter(1),
 	colorEngine(ScCore->defaultEngine),
-	TotalItems(0),
-	RePos(false),
-	OldBM(false),
-	hasName(false),
-	isConverted(false),
 	autoSaveTimer(new QTimer(this)),
-	WinHan(nullptr),
-	DoDrawing(true),
-	CurTimer(nullptr),
-	docHyphenator(nullptr),
 	m_itemCreationTransaction(nullptr),
-	m_alignTransaction(nullptr),
-	m_currentPage(nullptr),
-	m_docUpdater(nullptr),
-	m_flag_notesChanged(false),
-	flag_restartMarksRenumbering(false),
-	flag_updateMarksLabels(false),
-	flag_updateEndNotes(false),
-	flag_layoutNotesFrames(true),
-	flag_Renumber(false),
-	flag_NumUpdateRequest(false)
+	m_alignTransaction(nullptr)
 {
 	m_docUnitRatio=unitGetRatioFromIndex(m_docPrefsData.docSetupPrefs.docUnitIndex);
 	m_docPrefsData.docSetupPrefs.pageHeight=0;
@@ -278,11 +228,6 @@
 	m_docPrefsData.pdfPrefs.bleeds = m_docPrefsData.docSetupPrefs.bleeds;
 	m_docPrefsData.pdfPrefs.useDocBleeds = true;
 	Print_Options.firstUse = true;
-	drawAsPreview = false;
-	viewAsPreview = false;
-	editOnPreview = false;
-	previewVisual = 0;
-	dontResize = false;
 	//create default numeration
 	auto* numS = new NumStruct;
 	numS->m_name = "default";
@@ -295,73 +240,23 @@
 
 
 ScribusDoc::ScribusDoc(const QString& docName, int unitindex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup) : UndoObject( tr("Document")),
-	m_hasGUI(false),
-	m_docFilePermissions(QFileDevice::ReadOwner|QFileDevice::WriteOwner),
 	m_appPrefsData(PrefsManager::instance()->appPrefs),
 	m_docPrefsData(PrefsManager::instance()->appPrefs),
 	m_undoManager(UndoManager::instance()),
-	m_loading(false),
-	m_modified(false),
-	m_ActiveLayer(0),
 	m_docUnitRatio(unitGetRatioFromIndex(m_appPrefsData.docSetupPrefs.docUnitIndex)),
-	m_rotMode(0),
 	m_automaticTextFrames(pagesSetup.autoTextFrames),
-	m_masterPageMode(false),
-	m_symbolEditMode(false),
-	m_inlineEditMode(false),
-	m_ScMW(nullptr),
-	m_View(nullptr),
 	m_guardedObject(this),
-	m_serializer(nullptr),
-	m_tserializer(nullptr),
-	is12doc(false),
-	NrItems(0),
-	First(1), Last(0),
-	viewCount(0), viewID(0),
-	SnapGrid(false),
-	SnapGuides(true),
-	SnapElement(false),
-	GuideLock(false),
 	minCanvasCoordinate(FPoint(0, 0)),
-	rulerXoffset(0.0), rulerYoffset(0.0),
-	Pages(nullptr),
-	Items(nullptr),
 	m_Selection(new Selection(this, true)),
 	PageSp(pagesSetup.columnCount), PageSpa(pagesSetup.columnDistance),
 	FirstPnum(pagesSetup.firstPageNumber),
 	PageColors(this, true),
-	appMode(modeNormal),
-	SubMode(-1),
-	ShapeValues(nullptr),
-	ValCount(0),
 	m_documentFileName(docName),
 	AllFonts(&m_appPrefsData.fontPrefs.AvailFonts),
-	LastAuto(nullptr), FirstAuto(nullptr),
-	DraggedElem(nullptr),
-	ElemToLink(nullptr),
-	GroupCounter(1),
 	colorEngine(ScCore->defaultEngine),
-	TotalItems(0),
-	RePos(false),
-	OldBM(false),
-	hasName(false),
-	isConverted(false),
 	autoSaveTimer(new QTimer(this)),
-	WinHan(nullptr),
-	DoDrawing(true),
-	CurTimer(nullptr),
-	docHyphenator(nullptr),
 	m_itemCreationTransaction(nullptr),
-	m_alignTransaction(nullptr),
-	m_currentPage(nullptr),
-	m_docUpdater(nullptr),
-	m_flag_notesChanged(false),
-	flag_restartMarksRenumbering(false),
-	flag_updateMarksLabels(false),
-	flag_updateEndNotes(false),
-	flag_layoutNotesFrames(true),
-	flag_Renumber(false),
-	flag_NumUpdateRequest(false)
+	m_alignTransaction(nullptr)
 {
 	m_docPrefsData.docSetupPrefs.docUnitIndex=unitindex;
 	m_docPrefsData.docSetupPrefs.pageHeight=pagesize.height();
@@ -376,11 +271,6 @@
 	m_docPrefsData.docSetupPrefs.pageOrientation=pagesSetup.orientation;
 	m_docPrefsData.docSetupPrefs.pagePositioning=pagesSetup.pageArrangement;
 	Print_Options.firstUse = true;
-	drawAsPreview = false;
-	viewAsPreview = false;
-	editOnPreview = false;
-	previewVisual = 0;
-	dontResize = false;
 }
 
 
@@ -389,7 +279,6 @@
 	Q_CHECK_PTR(m_Selection);
 	Q_CHECK_PTR(autoSaveTimer);
 
-	HasCMS = false;
 	m_docPrefsData.colorPrefs.DCMSset.CMSinUse = false;
 
 	colorEngine = ScCore->defaultEngine;
@@ -3472,7 +3361,7 @@
 		if (layer.ID == layerID)
 			return layer.Name;
 	}
-	return QString::null;
+	return QString();
 }
 
 

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Fri Jun 21 22:20:38 2019
@@ -38,6 +38,7 @@
 #include <QTimer>
 #include <QFile>
 
+#include "appmodes.h"
 #include "gtgettext.h" //CB For the ImportSetup struct and itemadduserframe
 #include "scribusapi.h"
 #include "colormgmt/sccolormgmtengine.h"
@@ -217,7 +218,7 @@
 
 	// Add, delete and move pages
 	
-	ScPage* addPage(int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
+	ScPage* addPage(int pageNumber, const QString& masterPageName=QString(), const bool addAutoFrame=false);
 	void deletePage(int);
 	//! @brief Add a master page with this function, do not use addPage
 	ScPage* addMasterPage(int, const QString&);
@@ -274,7 +275,7 @@
 	 * @param activate the layer active
 	 * @return Number of the layer created
 	 */
-	int addLayer(const QString& layerName=QString::null, const bool activate=false);
+	int addLayer(const QString& layerName, const bool activate=false);
 	/**
 	 * @brief Copies a layer from the current document
 	 * @param layerIDToCopy source layer
@@ -946,24 +947,24 @@
 	 * @brief Add a section to the document sections list
 	 * Set number to -1 to add in the default section if the map is empty
 	 */
-	void addSection(const int number=0, const QString& name=QString::null, const uint fromindex=0, const uint toindex=0, const  NumFormat type=Type_1_2_3, const uint sectionstartindex=0, const bool reversed=false, const bool active=true, const QChar fillChar=QChar(), int fieldWidth=0);
+	void addSection(const int number=0, const QString& name=QString(), const uint fromindex=0, const uint toindex=0, const  NumFormat type=Type_1_2_3, const uint sectionstartindex=0, const bool reversed=false, const bool active=true, const QChar fillChar=QChar(), int fieldWidth=0);
 	/**
 	 * @brief Delete a section from the document sections list
 	 */
 	bool deleteSection(const uint);
 	/**
 	 * @brief Gets the page number to be printed based on the section it is in.
-	 * Returns QString::null on failure to find the pageIndex
+	 * Returns QString() on failure to find the pageIndex
 	 */
 	const QString getSectionPageNumberForPageIndex(const uint) const;
 	/**
 	 * @brief Gets the page number fill character to be printed based on the section it is in.
-	 * Returns QString::null on failure to find the pageIndex
+	 * Returns QString() on failure to find the pageIndex
 	 */
 	const QChar getSectionPageNumberFillCharForPageIndex(const uint) const;
 	/**
 	 * @brief Gets the page number fill character to be printed based on the section it is in.
-	 * Returns QString::null on failure to find the pageIndex
+	 * Returns QString() on failure to find the pageIndex
 	 */
 	int getSectionPageNumberWidthForPageIndex(const uint) const;
 	/**
@@ -1058,13 +1059,10 @@
 	void itemSelection_SetCharStyle(const CharStyle & newstyle, Selection* customSelection = nullptr);
 	void itemSelection_EraseParagraphStyle(Selection* customSelection = nullptr);
 	void itemSelection_EraseCharStyle(Selection* customSelection = nullptr);
-
 	void itemSelection_SetNamedParagraphStyle(const QString & name, Selection* customSelection = nullptr);
 	void itemSelection_SetNamedCharStyle(const QString & name, Selection* customSelection = nullptr);
 	void itemSelection_SetNamedLineStyle(const QString & name, Selection* customSelection = nullptr);
-
 	void itemSelection_SetSoftShadow(bool has, QString color, double dx, double dy, double radius, int shade, double opac, int blend, bool erase, bool objopa);
-
 	void itemSelection_SetLineWidth(double w);
 	void itemSelection_SetLineArt(Qt::PenStyle w);
 	void itemSelection_SetLineJoin(Qt::PenJoinStyle w);
@@ -1213,53 +1211,54 @@
 protected:
 	void addSymbols();
 	void applyPrefsPageSizingAndMargins(bool resizePages, bool resizeMasterPages, bool resizePageMargins, bool resizeMasterPageMargins);
-	bool m_hasGUI;
-	QFileDevice::Permissions m_docFilePermissions;
+	bool m_hasGUI {false};
+	QFileDevice::Permissions m_docFilePermissions {QFileDevice::ReadOwner|QFileDevice::WriteOwner};
 	ApplicationPrefs& m_appPrefsData;
 	ApplicationPrefs m_docPrefsData;
 	UndoManager * const m_undoManager;
-	bool m_loading;
-	bool m_modified;
-	int m_ActiveLayer;
+	bool m_loading {false};
+	bool m_modified {false};
+	int m_ActiveLayer {0};
 	double m_docUnitRatio;
-	int m_rotMode;
+	int m_rotMode {0};
 	bool m_automaticTextFrames; // Flag for automatic Textframes
-	bool m_masterPageMode;
-	bool m_symbolEditMode;
-	bool m_inlineEditMode;
-	int  m_storedLayerID;
-	bool m_storedLayerLock;
-	bool m_storedLayerVis;
+	bool m_masterPageMode {false};
+	bool m_symbolEditMode {false};
+	bool m_inlineEditMode {false};
+	int  m_storedLayerID {0};
+	bool m_storedLayerLock {false};
+	bool m_storedLayerVis {false};
 	QMap<QString, double> m_constants;
-	ScribusMainWindow* m_ScMW;
-	ScribusView* m_View;
+	ScribusMainWindow* m_ScMW {nullptr};
+	ScribusView* m_View {nullptr};
 	ScGuardedObject<ScribusDoc> m_guardedObject;
-	Serializer *m_serializer, *m_tserializer;
+	Serializer *m_serializer {nullptr};
+	Serializer *m_tserializer {nullptr};
 	QString m_currentEditedSymbol;
-	int m_currentEditedIFrame;
+	int m_currentEditedIFrame {0};
 	QString m_documentFileName;
 
 public: // Public attributes
-	bool is12doc; //public for now, it will be removed later
-	int NrItems;
-	int First;
-	int Last;
-	int viewCount;
-	int viewID;
-	bool SnapGrid;
-	bool SnapGuides;
-	bool SnapElement;
-	bool GuideLock;
-	bool dontResize;
+	bool is12doc {false}; //public for now, it will be removed later
+	int NrItems {0};
+	int First {1};
+	int Last {0};
+	int viewCount {0};
+	int viewID {0};
+	bool SnapGrid {false};
+	bool SnapGuides {false};
+	bool SnapElement {false};
+	bool GuideLock {false};
+	bool dontResize {false};
 	/** \brief Minimum and Maximum Points of Document */
 	FPoint minCanvasCoordinate;
 	FPoint maxCanvasCoordinate;
 	FPoint stored_minCanvasCoordinate;
 	FPoint stored_maxCanvasCoordinate;
-	double rulerXoffset;
-	double rulerYoffset;
+	double rulerXoffset {0.0};
+	double rulerYoffset {0.0};
 	/** \brief List of Pages */
-	QList<ScPage*>* Pages;
+	QList<ScPage*>* Pages {nullptr};
 	/** \brief List of Master Pages */
 	QList<ScPage*> MasterPages;
 	/** \brief List of Document Pages */
@@ -1269,7 +1268,7 @@
 	/** \brief Mapping Master Page Name to Master Page numbers */
 	QMap<QString,int> MasterNames;
 	/** \brief List of Objects */
-	QList<PageItem*>* Items;
+	QList<PageItem*>* Items {nullptr};
 	QList<PageItem*> MasterItems;
 	QList<PageItem*> DocItems;
 	QHash<int, PageItem*> FrameItems;
@@ -1277,32 +1276,32 @@
 
 	Selection* const m_Selection;
 	/** \brief Number of Columns */
-	double PageSp;
+	double PageSp {1.0};
 	/** \brief Distance of Columns */
-	double PageSpa;
+	double PageSpa {0.0};
 	///** \brief current Pagelayout */
 	//int currentPageLayout;
-	/** \brief Erste Seitennummer im Dokument */
-	int FirstPnum;
+	/** \brief First page number in document */
+	int FirstPnum {1};
 	/** \brief Im Dokument benutzte Farben */
 	ColorList PageColors;
-	int appMode;
-	int SubMode;
-	double *ShapeValues;
-	int ValCount;
+	int appMode {modeNormal};
+	int SubMode {-1};
+	double *ShapeValues {nullptr};
+	int ValCount {0};
 	QMap<QString,int> UsedFonts;
 	SCFonts * const AllFonts;
 	QList<AlignObjs> AObjects;
 	ParagraphStyle currentStyle;
 	NodeEditContext nodeEdit;
 	/** \brief Letztes Element fuer AutoTextrahmen */
-	PageItem *LastAuto;
+	PageItem *LastAuto {nullptr};
 	/** \brief Erstes Element fuer AutoTextrahmen */
-	PageItem *FirstAuto;
-	bool DragP;
-	bool leaveDrag;
-	PageItem *DraggedElem;
-	PageItem *ElemToLink;
+	PageItem *FirstAuto {nullptr};
+	bool DragP {false};
+	bool leaveDrag {false};
+	PageItem *DraggedElem {nullptr};
+	PageItem *ElemToLink {nullptr};
 	QList<PageItem*> DragElements;
 private:
 	StyleSet<ParagraphStyle> m_docParagraphStyles;
@@ -1312,7 +1311,7 @@
 public:
 	ScLayers Layers;
 	//bool marginColored;
-	int GroupCounter;
+	int GroupCounter {1};
 
 	ScColorMgmtEngine colorEngine;
 	ScColorProfile DocInputImageRGBProf;
@@ -1337,16 +1336,16 @@
 	ScColorTransform stdLabToScreenTrans;
 	ScColorTransform stdProofLab;
 	ScColorTransform stdProofLabGC;
-	bool BlackPoint;
-	bool SoftProofing;
-	bool Gamut;
+	bool BlackPoint {true};
+	bool SoftProofing {false};
+	bool Gamut {false};
 	eRenderIntent IntentColors;
 	eRenderIntent IntentImages;
-	bool HasCMS;
+	bool HasCMS {false};
 	QMap<QString,QString> JavaScripts;
-	int TotalItems;
+	int TotalItems {0};
 	PrintOptions Print_Options;
-	bool RePos;
+	bool RePos {false};
 	struct BookMa {
 		QString Title;
 		QString Text;
@@ -1362,20 +1361,20 @@
 		bool operator<(const BookMa& other) const { return ItemNr < other.ItemNr; }
 	};
 	QList<BookMa> BookMarks;
-	bool OldBM;
-	bool hasName;
-	bool isConverted;
+	bool OldBM {false};
+	bool hasName {false};
+	bool isConverted {false};
 	QTimer * const autoSaveTimer;
 	QList<QString> autoSaveFiles;
 	QHash<QString,multiLine> MLineStyles;
 	QHash<QString, ScPattern> docPatterns;
 	QHash<QString, VGradient> docGradients;
-	QWidget* WinHan;
-	bool DoDrawing;
-	bool drawAsPreview;
-	bool viewAsPreview;
-	bool editOnPreview;
-	int previewVisual;
+	QWidget* WinHan {nullptr};
+	bool DoDrawing {true};
+	bool drawAsPreview {false};
+	bool viewAsPreview {false};
+	bool editOnPreview {false};
+	int previewVisual {0};
 	struct OpenNodesList
 	{
 		int type;
@@ -1383,7 +1382,7 @@
 		PageItem *item;
 	};
 	QList<OpenNodesList> OpenNodes;
-	QTimer *CurTimer;
+	QTimer *CurTimer {nullptr};
 	QMap<int, errorCodes> pageErrors;
 	QMap<int, errorCodes> docLayerErrors;
 	QMap<PageItem*, errorCodes> docItemErrors;
@@ -1395,19 +1394,19 @@
 	FPointArray symNewCol;
 	FPointArray symNewFrame;
 	
-	Hyphenator * docHyphenator;
+	Hyphenator* docHyphenator {nullptr};
 	void itemResizeToMargin(PageItem* item, int direction); //direction reflect enum numbers from Canvas::FrameHandle
 
 private:
 	UndoTransaction m_itemCreationTransaction;
 	UndoTransaction m_alignTransaction;
 
-	ScPage* m_currentPage;
+	ScPage* m_currentPage {nullptr};
 	UpdateManager m_updateManager;
 	MassObservable<PageItem*> m_itemsChanged;
 	MassObservable<ScPage*> m_pagesChanged;
 	MassObservable<QRectF> m_regionsChanged;
-	DocUpdater* m_docUpdater;
+	DocUpdater* m_docUpdater {nullptr};
 	
 signals:
 	//Lets make our doc talk to our GUI rather than confusing all our normal stuff
@@ -1698,7 +1697,7 @@
 	QList<Mark*> m_docMarksList;
 	QList<TextNote*> m_docNotesList;
 	//flags used for indicating needs of updates
-	bool m_flag_notesChanged;
+	bool m_flag_notesChanged {false};
 
 public:
 	const QList<Mark*> marksList() { return m_docMarksList; }
@@ -1713,10 +1712,10 @@
 	//flags used for indicating needs of updates
 	bool notesChanged() { return m_flag_notesChanged; }
 	void setNotesChanged(bool on) { m_flag_notesChanged = on; }
-	bool flag_restartMarksRenumbering;
-	bool flag_updateMarksLabels;
-	bool flag_updateEndNotes;
-	bool flag_layoutNotesFrames;
+	bool flag_restartMarksRenumbering {false};
+	bool flag_updateMarksLabels {false};
+	bool flag_updateEndNotes {false};
+	bool flag_layoutNotesFrames {true};
 
 	//returns list of marks labels for given mark type
 	QStringList marksLabelsList(MarkType type);
@@ -1827,8 +1826,8 @@
 	void setupNumerations(); //read styles for used auto-numerations, initialize numCounters
 	QString getNumberStr(const QString& numName, int level, bool reset, const ParagraphStyle &style);
 	void setNumerationCounter(const QString& numName, int level, int number);
-	bool flag_Renumber;
-	bool flag_NumUpdateRequest;
+	bool flag_Renumber {false};
+	bool flag_NumUpdateRequest {false};
 	// for local numeration of paragraphs
 	bool updateLocalNums(StoryText& itemText); //return true if any num strings were updated and item need s invalidation
 	void updateNumbers(bool updateNumerations = false);

Modified: trunk/Scribus/scribus/ui/layers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/ui/layers.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/layers.cpp	(original)
+++ trunk/Scribus/scribus/ui/layers.cpp	Fri Jun 21 22:20:38 2019
@@ -309,7 +309,7 @@
 {
 	if (!m_Doc)
 		return;
-	m_Doc->addLayer(QString::null, true);
+	m_Doc->addLayer(QString(), true);
 	rebuildList();
 	markActiveLayer();
 	m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
@@ -325,15 +325,13 @@
 	
 	int current = m_Doc->activeLayer();
 	
-	m_Doc->addLayer(QString::null, true);
+	m_Doc->addLayer(QString(), true);
 	rebuildList();
 	markActiveLayer();
 	m_Doc->copyLayer(current, m_Doc->activeLayer());
 	m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
 	if (copyTransaction)
-	{
 		copyTransaction.commit();
-	}
 }
 
 void LayerPalette::removeLayer()

Modified: trunk/Scribus/scribus/units.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/units.cpp
==============================================================================
--- trunk/Scribus/scribus/units.cpp	(original)
+++ trunk/Scribus/scribus/units.cpp	Fri Jun 21 22:20:38 2019
@@ -369,10 +369,7 @@
 		int i = (static_cast<int>(unitValue))/12;
 		double d = fabs(fmod(unitValue, 12));
 		QString prefix((i == 0 && unitValue < 0.0) ? "-" : "");
-//		if (round2Precision)
-//			s=QString("%1%2%3%4").arg(prefix).arg(a).arg(unitGetStrFromIndex(unitIndex)).arg(QString::number(b, 'f', unitGetPrecisionFromIndex(unitIndex)));
-//		else
-			s=QString("%1%2%3%4").arg(prefix).arg(i).arg(unitGetStrFromIndex(unitIndex)).arg(d);
+		s=QString("%1%2%3%4").arg(prefix).arg(i).arg(unitGetStrFromIndex(unitIndex)).arg(d);
 	}
 	else
 	{

Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp	(original)
+++ trunk/Scribus/scribus/util.cpp	Fri Jun 21 22:20:38 2019
@@ -511,7 +511,7 @@
 {
 	uint number = pageNo + currDoc->FirstPnum;
 	QString defaultName;
-	if (prefix!=QString::null)
+	if (!prefix.isNull())
 		defaultName=prefix;
 	else
 		defaultName=currDoc->documentFileName();
@@ -580,7 +580,7 @@
 
 const QString numberToLetterSequence(const QString& letters, uint num)
 {
-	QString retVal("");
+	QString retVal;
 	unsigned digits = 1;
 	unsigned offset = 0;
 	uint column = num - 1;

Modified: trunk/Scribus/scribus/util.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23041&path=/trunk/Scribus/scribus/util.h
==============================================================================
--- trunk/Scribus/scribus/util.h	(original)
+++ trunk/Scribus/scribus/util.h	Fri Jun 21 22:20:38 2019
@@ -124,7 +124,7 @@
    \retval QString standardized filename
    \author Petr Vanek
  */
-QString SCRIBUS_API getFileNameByPage(ScribusDoc* currDoc, uint pageNo, const QString& extension, const QString& prefix=QString::null);
+QString SCRIBUS_API getFileNameByPage(ScribusDoc* currDoc, uint pageNo, const QString& extension, const QString& prefix=QString());
 //asterix is QString used in numeration when number is presented as few chars, like *, **, *** etc
 //default is '*' but can be used any string
 const QString SCRIBUS_API getStringFromSequence(NumFormat type, uint position, const QString& asterix="*");




More information about the scribus-commit mailing list