r24914 by craig - Clean up some initialisation in qt* classes.
scribus-commit
scribus-commit at lists.scribus.net
Sat Feb 5 16:48:12 UTC 2022
Author: craig
Date: Sat Feb 5 16:48:12 2022
New Revision: 24914
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24914
Log:
Clean up some initialisation in qt* classes.
Modified:
trunk/Scribus/scribus/gtframestyle.cpp
trunk/Scribus/scribus/gtframestyle.h
trunk/Scribus/scribus/gtgettext.cpp
trunk/Scribus/scribus/gtgettext.h
trunk/Scribus/scribus/gtparagraphstyle.cpp
trunk/Scribus/scribus/gtparagraphstyle.h
trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
trunk/Scribus/scribus/third_party/rtf-qt/UserPropsDestination.h
Modified: trunk/Scribus/scribus/gtframestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/gtframestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/gtframestyle.cpp (original)
+++ trunk/Scribus/scribus/gtframestyle.cpp Sat Feb 5 16:48:12 2022
@@ -30,10 +30,10 @@
gtFrameStyle::gtFrameStyle(const QString& name) :
gtParagraphStyle(name)
{
- init();
}
-gtFrameStyle::gtFrameStyle(const gtFrameStyle& f) : gtParagraphStyle(f)
+gtFrameStyle::gtFrameStyle(const gtFrameStyle& f) :
+ gtParagraphStyle(f)
{
m_columns = f.m_columns;
m_columnsGap = f.m_columnsGap;
@@ -41,22 +41,14 @@
m_bgShade = f.m_bgShade;
}
-gtFrameStyle::gtFrameStyle(const gtParagraphStyle& p) : gtParagraphStyle(p)
+gtFrameStyle::gtFrameStyle(const gtParagraphStyle& p) :
+ gtParagraphStyle(p)
{
- init();
}
-gtFrameStyle::gtFrameStyle(const gtStyle& s) : gtParagraphStyle(s)
+gtFrameStyle::gtFrameStyle(const gtStyle& s) :
+ gtParagraphStyle(s)
{
- init();
-}
-
-void gtFrameStyle::init()
-{
- m_columns = 1;
- m_columnsGap = 0;
- m_bgColor = "White";
- m_bgShade = 100;
}
int gtFrameStyle::getColumns() const
@@ -107,4 +99,4 @@
void gtFrameStyle::getParagraphStyle(gtParagraphStyle* pstyle)
{
*pstyle = gtParagraphStyle(*this);
-}
+}
Modified: trunk/Scribus/scribus/gtframestyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/gtframestyle.h
==============================================================================
--- trunk/Scribus/scribus/gtframestyle.h (original)
+++ trunk/Scribus/scribus/gtframestyle.h Sat Feb 5 16:48:12 2022
@@ -59,8 +59,6 @@
double m_columnsGap { 0.0 };
QString m_bgColor { "White" };
int m_bgShade { 100 };
-
- void init();
};
#endif // GTFRAMESTYLE_H
Modified: trunk/Scribus/scribus/gtgettext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/gtgettext.cpp
==============================================================================
--- trunk/Scribus/scribus/gtgettext.cpp (original)
+++ trunk/Scribus/scribus/gtgettext.cpp Sat Feb 5 16:48:12 2022
@@ -37,7 +37,6 @@
// Constructor
gtGetText::gtGetText(ScribusDoc* doc)
{
- m_dias = nullptr;
// Attach to the active document
m_Doc = doc;
// Load the plugins array.
Modified: trunk/Scribus/scribus/gtgettext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/gtgettext.h
==============================================================================
--- trunk/Scribus/scribus/gtgettext.h (original)
+++ trunk/Scribus/scribus/gtgettext.h Sat Feb 5 16:48:12 2022
@@ -78,7 +78,7 @@
// Loads the "DLL", validates the importer is good, populates the passed parameters with
// the plugin information.
void createMap(); // Create the importer Qmap.
- gtDialogs* m_dias; // File Selection Dialog pointer.
+ gtDialogs* m_dias {nullptr}; // File Selection Dialog pointer.
QStringList m_ilist; // List of supported importers, used with dialogs
ScribusDoc* m_Doc; // Which document are we working with.
public:
Modified: trunk/Scribus/scribus/gtparagraphstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/gtparagraphstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/gtparagraphstyle.cpp (original)
+++ trunk/Scribus/scribus/gtparagraphstyle.cpp Sat Feb 5 16:48:12 2022
@@ -30,12 +30,10 @@
gtParagraphStyle::gtParagraphStyle(const QString& name) :
gtStyle(name)
{
- init();
}
gtParagraphStyle::gtParagraphStyle(const gtParagraphStyle& p) : gtStyle(p)
{
- defaultStyle = false;
lineSpacing = p.lineSpacing;
alignment = p.alignment;
indent = p.indent;
@@ -43,50 +41,26 @@
spaceAbove = p.spaceAbove;
spaceBelow = p.spaceBelow;
dropCap = p.dropCap;
- m_bullet = p.m_bullet;
- m_bulletStr = p.m_bulletStr;
+ m_bullet = p.m_bullet;
+ m_bulletStr = p.m_bulletStr;
dropCapHeight = p.dropCapHeight;
- m_numeration = p.m_numeration;
- m_numFormat = p.m_numFormat;
- m_numLevel = p.m_numLevel;
- m_numStart = p.m_numStart;
- m_numPrefix = p.m_numPrefix;
- m_numSuffix = p.m_numSuffix;
+ m_numeration = p.m_numeration;
+ m_numFormat = p.m_numFormat;
+ m_numLevel = p.m_numLevel;
+ m_numStart = p.m_numStart;
+ m_numPrefix = p.m_numPrefix;
+ m_numSuffix = p.m_numSuffix;
adjToBaseline = p.adjToBaseline;
autoLineSpacing = p.autoLineSpacing;
isVisible = p.isVisible;
flags = p.flags;
}
-gtParagraphStyle::gtParagraphStyle(const gtStyle& s) : gtStyle(s)
-{
- init();
-}
-
-void gtParagraphStyle::init()
-{
- defaultStyle = false;
- lineSpacing = 15;
- alignment = LEFT;
- indent = 0;
- firstLineIndent = 0;
- spaceAbove = 0;
- spaceBelow = 0;
- dropCap = false;
- dropCapHeight = 2;
- m_bullet = false;
- m_bulletStr = QString(QChar(0x2022));
- m_numeration = false;
- m_numFormat = 0;
- m_numLevel = 0;
- m_numStart = 1;
- m_numPrefix.clear();
- m_numSuffix.clear();
- adjToBaseline = false;
- autoLineSpacing = false;
- isVisible = true;
- flags = 0;
-}
+gtParagraphStyle::gtParagraphStyle(const gtStyle& s) :
+ gtStyle(s)
+{
+}
+
QString gtParagraphStyle::target() const
{
@@ -250,7 +224,7 @@
void gtParagraphStyle::setBullet(bool newBullet, const QString& str)
{
m_bullet = newBullet;
- if (str != "")
+ if (!str.isEmpty())
m_bulletStr = str;
else
m_bulletStr = QString(QChar(0x2022));
Modified: trunk/Scribus/scribus/gtparagraphstyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/gtparagraphstyle.h
==============================================================================
--- trunk/Scribus/scribus/gtparagraphstyle.h (original)
+++ trunk/Scribus/scribus/gtparagraphstyle.h Sat Feb 5 16:48:12 2022
@@ -142,8 +142,6 @@
bool autoLineSpacing { false };
bool isVisible { true };
-private:
- void init();
};
#endif // GTPARAGRAPHSTYLE_H
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp Sat Feb 5 16:48:12 2022
@@ -486,6 +486,6 @@
QStringList s;
s << scribus_getproperty__doc__
<< scribus_getpropertynames__doc__
- << scribus_propertyctype__doc__
+ << scribus_propertyctype__doc__
<< scribus_setproperty__doc__;
}
Modified: trunk/Scribus/scribus/third_party/rtf-qt/UserPropsDestination.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24914&path=/trunk/Scribus/scribus/third_party/rtf-qt/UserPropsDestination.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/UserPropsDestination.h (original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/UserPropsDestination.h Sat Feb 5 16:48:12 2022
@@ -31,7 +31,6 @@
{
public:
UserPropsDestination( Reader *reader, AbstractRtfOutput *output, const QString &name );
-
virtual ~UserPropsDestination();
virtual void handleControlWord( const QString &controlWord, bool hasValue, const int value );
More information about the scribus-commit
mailing list