r22553 by craig - Fix some more nullptr stuff, rework slots calls to be simpler, fix some unneeded allocations
scribus-commit
scribus-commit at lists.scribus.net
Thu May 24 16:57:03 UTC 2018
Author: craig
Date: Thu May 24 16:57:03 2018
New Revision: 22553
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22553
Log:
Fix some more nullptr stuff, rework slots calls to be simpler, fix some unneeded allocations
Modified:
trunk/Scribus/Scribus.pro
trunk/Scribus/scribus/actionmanager.cpp
trunk/Scribus/scribus/actionmanager.h
trunk/Scribus/scribus/appmodehelper.cpp
trunk/Scribus/scribus/appmodehelper.h
trunk/Scribus/scribus/pageitem.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusdoc.h
trunk/Scribus/scribus/ui/storyeditor.cpp
Modified: trunk/Scribus/Scribus.pro
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/Scribus.pro
==============================================================================
--- trunk/Scribus/Scribus.pro (original)
+++ trunk/Scribus/Scribus.pro Thu May 24 16:57:03 2018
@@ -1,5 +1,5 @@
######################################################################
-# Automatically generated by qmake (3.1) Thu Apr 19 22:42:14 2018
+# Automatically generated by qmake (3.1) Sun May 20 10:57:32 2018
######################################################################
INCLUDEPATH+=./scribus
@@ -960,6 +960,7 @@
scribus/plugins/import/pct/importpct.h \
scribus/plugins/import/pct/importpctplugin.h \
scribus/plugins/import/pdf/importpdf.h \
+ scribus/plugins/import/pdf/importpdfconfig.h \
scribus/plugins/import/pdf/importpdfplugin.h \
scribus/plugins/import/pdf/pdfimportoptions.h \
scribus/plugins/import/pdf/slaoutput.h \
Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Thu May 24 16:57:03 2018
@@ -39,14 +39,14 @@
ActionManager::ActionManager ( QObject * parent ) :
QObject ( parent),
- mainWindow(0),
- undoManager(0),
- im(0),
- scrActions(0),
- scrActionGroups(0),
- modeActionNames(0),
- nonEditActionNames(0),
- unicodeCharActionNames(0)
+ mainWindow(nullptr),
+ undoManager(nullptr),
+ im(nullptr),
+ scrActions(nullptr),
+ scrActionGroups(nullptr),
+ modeActionNames(nullptr),
+ nonEditActionNames(nullptr),
+ unicodeCharActionNames(nullptr)
{
}
@@ -86,7 +86,7 @@
setActionTooltips(scrActions);
}
-bool ActionManager::compareKeySeqToShortcut(QKeySequence ks, QString actionName)
+bool ActionManager::compareKeySeqToShortcut(const QKeySequence& ks, const QString& actionName)
{
if (!scrActions->contains(actionName))
return false;
@@ -95,7 +95,7 @@
return false;
}
-bool ActionManager::compareKeySeqToShortcut(int k, Qt::KeyboardModifiers km, QString actionName)
+bool ActionManager::compareKeySeqToShortcut(int k, Qt::KeyboardModifiers km, const QString& actionName)
{
return compareKeySeqToShortcut(QKeySequence(k | km), actionName);
}
@@ -937,7 +937,7 @@
#ifdef HAVE_OSG
*modeActionNames << "toolsPDFAnnot3D";
#endif
- for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
+ for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
{
(*scrActions)[*it]->setEnabled(false);
(*scrActions)[*it]->setToggleAction(true);
@@ -1213,40 +1213,40 @@
void ActionManager::disconnectNewDocActions()
{
- disconnect( (*scrActions)["tableInsertRows"], 0, 0, 0 );
- disconnect( (*scrActions)["tableInsertColumns"], 0, 0, 0 );
- disconnect( (*scrActions)["tableDeleteRows"], 0, 0, 0 );
- disconnect( (*scrActions)["tableDeleteColumns"], 0, 0, 0 );
- disconnect( (*scrActions)["tableMergeCells"], 0, 0, 0 );
- disconnect( (*scrActions)["tableSplitCells"], 0, 0, 0 );
- disconnect( (*scrActions)["tableSetRowHeights"], 0, 0, 0 );
- disconnect( (*scrActions)["tableSetColumnWidths"], 0, 0, 0 );
- disconnect( (*scrActions)["tableDistributeRowsEvenly"], 0, 0, 0 );
- disconnect( (*scrActions)["tableDistributeColumnsEvenly"], 0, 0, 0 );
- disconnect( (*scrActions)["tableAdjustFrameToTable"], 0, 0, 0 );
- disconnect( (*scrActions)["tableAdjustTableToFrame"], 0, 0, 0 );
- disconnect( (*scrActions)["itemAdjustFrameHeightToText"], 0, 0, 0 );
- disconnect( (*scrActions)["itemAdjustFrameToImage"], 0, 0, 0 );
- disconnect( (*scrActions)["itemAdjustImageToFrame"], 0, 0, 0 );
- disconnect( (*scrActions)["itemLock"], 0, 0, 0);
- disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
- disconnect( (*scrActions)["itemPrintingEnabled"], 0, 0, 0);
- disconnect( (*scrActions)["itemFlipH"], 0, 0, 0);
- disconnect( (*scrActions)["itemFlipV"], 0, 0, 0);
- disconnect( (*scrActions)["itemCombinePolygons"], 0, 0, 0);
- disconnect( (*scrActions)["itemSplitPolygons"], 0, 0, 0);
- disconnect( (*scrActions)["itemUpdateImage"], 0, 0, 0 );
- disconnect( (*scrActions)["itemDelete"], 0, 0, 0);
- disconnect( (*scrActions)["extrasHyphenateText"], 0, 0, 0 );
- disconnect( (*scrActions)["extrasDeHyphenateText"], 0, 0, 0 );
- disconnect( (*scrActions)["itemsUnWeld"], 0, 0, 0);
- disconnect( (*scrActions)["itemWeld"], 0, 0, 0);
- disconnect( (*scrActions)["itemEditWeld"], 0, 0, 0);
- disconnect( (*scrActions)["itemLowerToBottom"], 0, 0, 0);
- disconnect( (*scrActions)["itemRaiseToTop"], 0, 0, 0);
- disconnect( (*scrActions)["itemLower"], 0, 0, 0);
- disconnect( (*scrActions)["itemRaise"], 0, 0, 0);
- disconnect( (*scrActions)["toolsUnlinkTextFrameAndCutText"], 0, 0, 0 );
+ (*scrActions)["tableInsertRows"]->disconnect();
+ (*scrActions)["tableInsertColumns"]->disconnect();
+ (*scrActions)["tableDeleteRows"]->disconnect();
+ (*scrActions)["tableDeleteColumns"]->disconnect();
+ (*scrActions)["tableMergeCells"]->disconnect();
+ (*scrActions)["tableSplitCells"]->disconnect();
+ (*scrActions)["tableSetRowHeights"]->disconnect();
+ (*scrActions)["tableSetColumnWidths"]->disconnect();
+ (*scrActions)["tableDistributeRowsEvenly"]->disconnect();
+ (*scrActions)["tableDistributeColumnsEvenly"]->disconnect();
+ (*scrActions)["tableAdjustFrameToTable"]->disconnect();
+ (*scrActions)["tableAdjustTableToFrame"]->disconnect();
+ (*scrActions)["itemAdjustFrameHeightToText"]->disconnect();
+ (*scrActions)["itemAdjustFrameToImage"]->disconnect();
+ (*scrActions)["itemAdjustImageToFrame"]->disconnect();
+ (*scrActions)["itemLock"]->disconnect();
+ (*scrActions)["itemLockSize"]->disconnect();
+ (*scrActions)["itemPrintingEnabled"]->disconnect();
+ (*scrActions)["itemFlipH"]->disconnect();
+ (*scrActions)["itemFlipV"]->disconnect();
+ (*scrActions)["itemCombinePolygons"]->disconnect();
+ (*scrActions)["itemSplitPolygons"]->disconnect();
+ (*scrActions)["itemUpdateImage"]->disconnect();
+ (*scrActions)["itemDelete"]->disconnect();
+ (*scrActions)["extrasHyphenateText"]->disconnect();
+ (*scrActions)["extrasDeHyphenateText"]->disconnect();
+ (*scrActions)["itemsUnWeld"]->disconnect();
+ (*scrActions)["itemWeld"]->disconnect();
+ (*scrActions)["itemEditWeld"]->disconnect();
+ (*scrActions)["itemLowerToBottom"]->disconnect();
+ (*scrActions)["itemRaiseToTop"]->disconnect();
+ (*scrActions)["itemLower"]->disconnect();
+ (*scrActions)["itemRaise"]->disconnect();
+ (*scrActions)["toolsUnlinkTextFrameAndCutText"]->disconnect();
}
void ActionManager::connectNewDocActions(ScribusDoc *currDoc)
@@ -1292,23 +1292,23 @@
void ActionManager::disconnectNewViewActions()
{
//qDebug()<<"disconnectNewViewActions"<<mainWindow->doc->DocName;
- disconnect( (*scrActions)["viewPreviewMode"], 0, 0, 0);
- disconnect( (*scrActions)["viewEditInPreview"], 0, 0, 0);
- disconnect( (*scrActions)["viewToggleCMS"], 0, 0, 0);
- disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
- disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
- disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
- disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)), 0, 0 );
- disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)), 0, 0 );
- disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)), 0, 0 );
- disconnect( (*scrActions)["itemConvertToBezierCurve"], 0, 0, 0);
- disconnect( (*scrActions)["itemConvertToImageFrame"], 0, 0, 0);
- disconnect( (*scrActions)["itemConvertToOutlines"], 0, 0, 0);
- disconnect( (*scrActions)["itemConvertToPolygon"], 0, 0, 0);
- disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
- disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
- disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
- disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0);
+ (*scrActions)["viewPreviewMode"]->disconnect();
+ (*scrActions)["viewEditInPreview"]->disconnect();
+ (*scrActions)["viewToggleCMS"]->disconnect();
+ (*scrActions)["toolsZoomIn"]->disconnect();
+ (*scrActions)["toolsZoomOut"]->disconnect();
+ (*scrActions)["itemImageIsVisible"]->disconnect();
+ (*scrActions)["itemPreviewFull"]->disconnect(SIGNAL(triggeredData(int)));
+ (*scrActions)["itemPreviewNormal"]->disconnect(SIGNAL(triggeredData(int)));
+ (*scrActions)["itemPreviewLow"]->disconnect(SIGNAL(triggeredData(int)));
+ (*scrActions)["itemConvertToBezierCurve"]->disconnect();
+ (*scrActions)["itemConvertToImageFrame"]->disconnect();
+ (*scrActions)["itemConvertToOutlines"]->disconnect();
+ (*scrActions)["itemConvertToPolygon"]->disconnect();
+ (*scrActions)["itemConvertToTextFrame"]->disconnect();
+ (*scrActions)["itemAttachTextToPath"]->disconnect();
+ (*scrActions)["itemDetachTextFromPath"]->disconnect();
+ (*scrActions)["itemExtendedImageProperties"]->disconnect();
}
void ActionManager::connectNewViewActions(ScribusView *currView)
@@ -1333,13 +1333,13 @@
void ActionManager::disconnectNewSelectionActions()
{
- disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
+ (*scrActions)["itemImageIsVisible"]->disconnect();
//Only disconnect triggeredData for data based actions or you will disconnect the internal signal
- disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)) , 0, 0);
- disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)) , 0, 0);
- disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)) , 0, 0);
- disconnect( (*scrActions)["editClearContents"], 0, 0, 0);
- disconnect( (*scrActions)["editTruncateContents"], 0, 0, 0);
+ (*scrActions)["itemPreviewFull"]->disconnect(SIGNAL(triggeredData(int)));
+ (*scrActions)["itemPreviewNormal"]->disconnect(SIGNAL(triggeredData(int)));
+ (*scrActions)["itemPreviewLow"]->disconnect(SIGNAL(triggeredData(int)));
+ (*scrActions)["editClearContents"]->disconnect();
+ (*scrActions)["editTruncateContents"]->disconnect();
}
void ActionManager::connectNewSelectionActions(ScribusView* /*currView*/, ScribusDoc* currDoc)
@@ -1431,8 +1431,8 @@
if (currItem==nullptr)
return;
- disconnect( (*scrActions)["itemPDFIsBookmark"], 0, 0, 0);
- disconnect( (*scrActions)["itemPDFIsAnnotation"], 0, 0, 0);
+ (*scrActions)["itemPDFIsBookmark"]->disconnect();
+ (*scrActions)["itemPDFIsAnnotation"]->disconnect();
if (!currItem->asTextFrame())
{
Modified: trunk/Scribus/scribus/actionmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/actionmanager.h
==============================================================================
--- trunk/Scribus/scribus/actionmanager.h (original)
+++ trunk/Scribus/scribus/actionmanager.h Thu May 24 16:57:03 2018
@@ -59,19 +59,19 @@
virtual void changeEvent(QEvent *e);
void init(ScribusMainWindow *);
- bool compareKeySeqToShortcut(QKeySequence ks, QString actionName);
- bool compareKeySeqToShortcut(int k, Qt::KeyboardModifiers km, QString actionName);
+ bool compareKeySeqToShortcut(const QKeySequence& ks, const QString& actionName);
+ bool compareKeySeqToShortcut(int k, Qt::KeyboardModifiers km, const QString& actionName);
static void createDefaultShortcuts();
- static QMap<QString, QKeySequence>* defaultShortcuts() {return &defKeys;};
+ static QMap<QString, QKeySequence>* defaultShortcuts() {return &defKeys;}
static void createDefaultMenus();
static void createDefaultMenuNames();
static void createDefaultNonMenuActions();
static void createDefaultNonMenuNames();
- static QVector< QPair<QString, QStringList> >* defaultMenuNames() {return &defMenuNames;};
- static QVector< QPair<QString, QStringList> >* defaultNonMenuNames() {return &defNonMenuNames;};
+ static QVector< QPair<QString, QStringList> >* defaultMenuNames() {return &defMenuNames;}
+ static QVector< QPair<QString, QStringList> >* defaultNonMenuNames() {return &defNonMenuNames;}
static QString defaultMenuNameEntryTranslated(const QString& index);
- static QVector< QPair<QString, QStringList> >* defaultMenus() {return &defMenus;};
- static QVector< QPair<QString, QStringList> >* defaultNonMenuActions() {return &defNonMenuActions;};
+ static QVector< QPair<QString, QStringList> >* defaultMenus() {return &defMenus;}
+ static QVector< QPair<QString, QStringList> >* defaultNonMenuActions() {return &defNonMenuActions;}
void createActions();
void disconnectModeActions();
void connectModeActions();
Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp (original)
+++ trunk/Scribus/scribus/appmodehelper.cpp Thu May 24 16:57:03 2018
@@ -97,7 +97,7 @@
int oldMode = doc->appMode;
- PageItem *currItem=0;
+ PageItem *currItem=nullptr;
if (!doc->m_Selection->isEmpty())
currItem = doc->m_Selection->itemAt(0);
@@ -148,7 +148,7 @@
(*a_scrActions)["editClearContents"]->setEnabled(false);
(*a_scrActions)["editTruncateContents"]->setEnabled(false);
scmw->charPalette->setEnabled(false, 0);
- if (currItem != 0)
+ if (currItem != nullptr)
{
currItem->update();
if (currItem->asTextFrame())
@@ -193,7 +193,7 @@
case modeEditTable:
if (newMode != modeEditTable)
{
- scmw->charPalette->setEnabled(false, 0);
+ scmw->charPalette->setEnabled(false, nullptr);
enableTextActions(false);
(*a_scrActions)["insertSampleText"]->setEnabled(false);
(*a_scrActions)["toolsEditWithStoryEditor"]->setEnabled(false);
@@ -216,7 +216,7 @@
case modeNormal:
{
bool editSearchReplace = false;
- if (currItem != 0)
+ if (currItem != nullptr)
{
editSearchReplace |= currItem->isTextFrame();
editSearchReplace |= (currItem->itemText.length() > 0);
@@ -224,11 +224,11 @@
}
(*a_scrActions)["editSearchReplace"]->setEnabled(editSearchReplace);
- (*a_scrActions)["editCut"]->setEnabled(currItem != 0);
- (*a_scrActions)["editCopy"]->setEnabled(currItem != 0);
- (*a_scrActions)["editClearContents"]->setEnabled(currItem != 0);
+ (*a_scrActions)["editCut"]->setEnabled(currItem != nullptr);
+ (*a_scrActions)["editCopy"]->setEnabled(currItem != nullptr);
+ (*a_scrActions)["editClearContents"]->setEnabled(currItem != nullptr);
(*a_scrActions)["editPaste"]->setEnabled(ScMimeData::clipboardHasScribusData());
- (*a_scrActions)["editTruncateContents"]->setEnabled(currItem != 0);
+ (*a_scrActions)["editTruncateContents"]->setEnabled(currItem != nullptr);
scmw->propertiesPalette->setGradientEditMode(false);
scmw->outlinePalette->setEnabled(true);
@@ -285,7 +285,7 @@
{
if (oldMode != modeEdit)
a_actMgr->saveActionShortcutsPreEditMode();
- if (currItem != 0)
+ if (currItem != nullptr)
{
currItem->itemText.setCursorPosition(0);
scmw->setTBvals(currItem);
@@ -304,7 +304,7 @@
}
setTextEditMode(true);
- if (currItem != 0)
+ if (currItem != nullptr)
{
(*a_scrActions)["editCut"]->setEnabled(currItem->HasSel);
(*a_scrActions)["editCopy"]->setEnabled(currItem->HasSel);
@@ -1288,8 +1288,8 @@
void AppModeHelper::updateTableMenuActions(ScribusDoc* doc)
{
// Determine state.
- PageItem* item = doc ? doc->m_Selection->itemAt(0) : 0;
- PageItem_Table* table = (item && item->isTable()) ? item->asTable() : 0;
+ PageItem* item = doc ? doc->m_Selection->itemAt(0) : nullptr;
+ PageItem_Table* table = (item && item->isTable()) ? item->asTable() : nullptr;
if (!doc || !table)
{
@@ -1722,6 +1722,7 @@
void AppModeHelper::setStartupActionsEnabled(bool enabled)
{
+ Q_UNUSED(enabled);
(*a_scrActions)["fileDocSetup150"]->setEnabled(false);
(*a_scrActions)["filePrint"]->setEnabled(false);
(*a_scrActions)["fileSave"]->setEnabled(false);
Modified: trunk/Scribus/scribus/appmodehelper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/appmodehelper.h
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.h (original)
+++ trunk/Scribus/scribus/appmodehelper.h Thu May 24 16:57:03 2018
@@ -35,7 +35,7 @@
friend class ScribusMainWindow;
public:
- explicit AppModeHelper(QObject *parent = 0);
+ explicit AppModeHelper(QObject *parent = nullptr);
void setup(ActionManager* am, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *);
void resetApplicationMode(ScribusMainWindow* scmw, int newMode);
void setApplicationMode(ScribusMainWindow* scmw, ScribusDoc* doc, int newMode);
Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Thu May 24 16:57:03 2018
@@ -10026,7 +10026,7 @@
// and cause progressive slowdowns
// PropertiesPalette* pp=m_Doc->scMW()->propertiesPalette;
// disconnect(this, 0, pp, 0);
- disconnect(this, 0, 0, 0);
+ this->disconnect();
return true;
}
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Thu May 24 16:57:03 2018
@@ -1208,14 +1208,14 @@
for (itg = docGradients.begin(); itg != docGradients.end(); ++itg)
{
QList<VColorStop*> cstops = itg.value().colorStops();
- for (uint cst = 0; cst < itg.value().Stops(); ++cst)
+ for (int cst = 0; cst < itg.value().Stops(); ++cst)
{
lists.collectColor(cstops.at(cst)->name);
}
}
}
-bool ScribusDoc::styleExists(QString styleName)
+bool ScribusDoc::styleExists(const QString& styleName)
{
for (int i = 0; i < paragraphStyles().count(); ++i)
{
@@ -1450,7 +1450,7 @@
QMap<QString,QString>::ConstIterator itc;
QList<VColorStop*> cstops = itg.value().colorStops();
- for (uint cst = 0; cst < itg.value().Stops(); ++cst)
+ for (int cst = 0; cst < itg.value().Stops(); ++cst)
{
itc = newNames.colors().find(cstops.at(cst)->name);
if (itc != newNames.colors().end())
@@ -16145,11 +16145,11 @@
for (it3a = uf.begin(); it3a != it3aend; ++it3a)
AddFont(*it3a);
- uint itemCount=Items->count();
- for (uint b=0; b<itemCount; ++b)
- {
- if (Items->at(b)->itemType() == PageItem::ImageFrame)
- Items->at(b)->setImageVisible(m_docPrefsData.guidesPrefs.showPic);
+ int itemCount=Items->count();
+ for (int i=0; i<itemCount; ++i)
+ {
+ if (Items->at(i)->itemType() == PageItem::ImageFrame)
+ Items->at(i)->setImageVisible(m_docPrefsData.guidesPrefs.showPic);
}
double oldBaseGridValue = oldPrefsData.guidesPrefs.valueBaselineGrid;
@@ -16536,7 +16536,7 @@
if (!style.hasNum())
continue;
- QString name = style.numName();
+ const QString& name = style.numName();
if (numerations.contains(name))
numS = numerations.value(name);
else
@@ -16584,7 +16584,7 @@
flag_Renumber = true;
}
-QString ScribusDoc::getNumberStr(QString numName, int level, bool reset, const ParagraphStyle &style)
+QString ScribusDoc::getNumberStr(const QString& numName, int level, bool reset, const ParagraphStyle &style)
{
Q_ASSERT(numerations.contains(numName));
NumStruct * numS = numerations.value(numName, (NumStruct*) 0);
@@ -16617,7 +16617,7 @@
return result;
}
-void ScribusDoc::setNumerationCounter(QString numName, int level, int number)
+void ScribusDoc::setNumerationCounter(const QString& numName, int level, int number)
{
if (!numerations.contains(numName))
return;
@@ -16642,7 +16642,7 @@
Mark* mark = itemText.mark(pos);
if (mark != nullptr && mark->isType(MARKBullNumType) && itemText.paragraphStyle(pos).hasNum())
{
- ParagraphStyle style = itemText.paragraphStyle(pos);
+ const ParagraphStyle& style = itemText.paragraphStyle(pos);
if (style.numName() == "<local block>")
{
int level = style.numLevel();
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Thu May 24 16:57:03 2018
@@ -590,7 +590,7 @@
ResourceCollection m_newNames;
};
void replaceNamedResources(ResourceCollection& newNames);
- bool styleExists(QString styleName);
+ bool styleExists(const QString& styleName);
QList<int> getSortedStyleList();
QList<int> getSortedCharStyleList();
@@ -1818,8 +1818,8 @@
QMap<QString, NumStruct*> numerations;
QStringList orgNumNames; //orgNumerations keeps original settings read from paragraph styles for reset settings overrided localy
void setupNumerations(); //read styles for used auto-numerations, initialize numCounters
- QString getNumberStr(QString numName, int level, bool reset, const ParagraphStyle &style);
- void setNumerationCounter(QString numName, int level, int number);
+ 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;
// for local numeration of paragraphs
Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22553&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp Thu May 24 16:57:03 2018
@@ -2069,49 +2069,49 @@
void StoryEditor::disconnectSignals()
{
- disconnect(Editor,0,0,0);
- disconnect(Editor->document(), 0,0,0);
- disconnect(EditorBar,0,0,0);
- disconnect(AlignTools,0,0,0);
- disconnect(FillTools,0,0,0);
- disconnect(FontTools,0,0,0);
- disconnect(StrokeTools,0,0,0);
- disconnect(StyleTools,0,0,0);
+ Editor->disconnect();
+ Editor->document()->disconnect();
+ EditorBar->disconnect();
+ AlignTools->disconnect();
+ FillTools->disconnect();
+ FontTools->disconnect();
+ StrokeTools->disconnect();
+ StyleTools->disconnect();
}
void StoryEditor::connectSignals()
{
connect(Editor, SIGNAL(textChanged()), this, SLOT(modifiedText()));
// connect(Editor, SIGNAL(clicked(int, int)), this, SLOT(updateProps(int, int)));
- connect(Editor, SIGNAL(setProps(int, int)), this, SLOT(updateProps(int, int)));
+ connect(Editor, SIGNAL(setProps(int,int)), this, SLOT(updateProps(int, int)));
connect(Editor, SIGNAL(cursorPositionChanged()), this, SLOT(updateProps()));
- connect(Editor, SIGNAL(copyAvailable(bool)), this, SLOT(CopyAvail(bool )));
+ connect(Editor, SIGNAL(copyAvailable(bool)), this, SLOT(CopyAvail(bool)));
connect(Editor, SIGNAL(PasteAvail()), this, SLOT(PasteAvail()));
- connect(Editor, SIGNAL(contentsMoving(int, int)), EditorBar, SLOT(doMove(int, int )));
+ connect(Editor, SIGNAL(contentsMoving(int,int)), EditorBar, SLOT(doMove(int,int )));
connect(Editor, SIGNAL(textChanged()), EditorBar, SLOT(doRepaint()));
- connect(Editor, SIGNAL(SideBarUp(bool )), EditorBar, SLOT(setRepaint(bool )));
- connect(Editor, SIGNAL(SideBarUpdate( )), EditorBar, SLOT(doRepaint()));
- connect(Editor->document(), SIGNAL(contentsChange(int, int, int)), Editor, SLOT(handleContentsChange(int, int, int)));
+ connect(Editor, SIGNAL(SideBarUp(bool)), EditorBar, SLOT(setRepaint(bool )));
+ connect(Editor, SIGNAL(SideBarUpdate()), EditorBar, SLOT(doRepaint()));
+ connect(Editor->document(), SIGNAL(contentsChange(int,int,int)), Editor, SLOT(handleContentsChange(int,int,int)));
Editor->SuspendContentsChange = 0;
// 10/12/2004 - pv - #1203: wrong selection on double click
// connect(Editor, SIGNAL(doubleClicked(int, int)), this, SLOT(doubleClick(int, int)));
- connect(EditorBar, SIGNAL(ChangeStyle(int, const QString& )), this, SLOT(changeStyleSB(int, const QString&)));
+ connect(EditorBar, SIGNAL(ChangeStyle(int, const QString&)), this, SLOT(changeStyleSB(int, const QString&)));
// connect(EditorBar, SIGNAL(sigEditStyles()), this, SLOT(slotEditStyles()));
connect(AlignTools, SIGNAL(newParaStyle(const QString&)), this, SLOT(newStyle(const QString&)));
connect(AlignTools, SIGNAL(newAlign(int)), this, SLOT(newAlign(int)));
connect(AlignTools, SIGNAL(newDirection(int)), this, SLOT(newDirection(int)));
connect(FillTools, SIGNAL(NewColor(int, int)), this, SLOT(newTxFill(int, int)));
connect(StrokeTools, SIGNAL(NewColor(int, int)), this, SLOT(newTxStroke(int, int)));
- connect(FontTools, SIGNAL(newSize(double )), this, SLOT(newTxSize(double)));
- connect(FontTools, SIGNAL(newFont(const QString& )), this, SLOT(newTxFont(const QString& )));
- connect(FontTools, SIGNAL(newScaleH(double )), this, SLOT(newTxScale()));
- connect(FontTools, SIGNAL(newScaleV(double )), this, SLOT(newTxScaleV()));
- connect(StyleTools, SIGNAL(NewKern(double )), this, SLOT(newTxKern(double )));
- connect(StyleTools, SIGNAL(newStyle(int )), this, SLOT(newTxStyle(int )));
+ connect(FontTools, SIGNAL(newSize(double)), this, SLOT(newTxSize(double)));
+ connect(FontTools, SIGNAL(newFont(const QString&)), this, SLOT(newTxFont(const QString&)));
+ connect(FontTools, SIGNAL(newScaleH(double)), this, SLOT(newTxScale()));
+ connect(FontTools, SIGNAL(newScaleV(double)), this, SLOT(newTxScaleV()));
+ connect(StyleTools, SIGNAL(NewKern(double)), this, SLOT(newTxKern(double)));
+ connect(StyleTools, SIGNAL(newStyle(int)), this, SLOT(newTxStyle(int)));
connect(StyleTools, SIGNAL(NewShadow(double, double)), this, SLOT(newShadowOffs(double, double)));
- connect(StyleTools, SIGNAL(newOutline(double )), this, SLOT(newTxtOutline(double )));
+ connect(StyleTools, SIGNAL(newOutline(double)), this, SLOT(newTxtOutline(double)));
connect(StyleTools, SIGNAL(newUnderline(double, double)), this, SLOT(newTxtUnderline(double, double)));
- connect(StyleTools, SIGNAL(newStrike(double, double )), this, SLOT(newTxtStrike(double, double)));
+ connect(StyleTools, SIGNAL(newStrike(double, double)), this, SLOT(newTxtStrike(double, double)));
}
void StoryEditor::setCurrentDocumentAndItem(ScribusDoc *doc, PageItem *item)
@@ -2725,7 +2725,7 @@
charSelectUsed = true;
if (charSelect->isVisible())
return;
- charSelect->setEnabled(true, 0);
+ charSelect->setEnabled(true, nullptr);
charSelect->setDoc(m_doc);
charSelect->show();
}
More information about the scribus-commit
mailing list