r25046 by jghali - Code cleanup
scribus-commit
scribus-commit at lists.scribus.net
Fri Mar 18 22:52:42 UTC 2022
Author: jghali
Date: Fri Mar 18 22:52:42 2022
New Revision: 25046
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25046
Log:
Code cleanup
Modified:
branches/Version15x/Scribus/scribus/desaxe/saxio.h
branches/Version15x/Scribus/scribus/scribus.cpp
Modified: branches/Version15x/Scribus/scribus/desaxe/saxio.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25046&path=/branches/Version15x/Scribus/scribus/desaxe/saxio.h
==============================================================================
--- branches/Version15x/Scribus/scribus/desaxe/saxio.h (original)
+++ branches/Version15x/Scribus/scribus/desaxe/saxio.h Fri Mar 18 22:52:42 2022
@@ -33,7 +33,7 @@
Writes an XML representation of this object using the default element tag, see below
*/
virtual void saxx(SaxHandler & ) const = 0;
- virtual ~SaxIO() {}
+ virtual ~SaxIO() = default;
/**
Element tag which is usually used to serialize this object. "" means no elem is created by saxx()
*/
Modified: branches/Version15x/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25046&path=/branches/Version15x/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version15x/Scribus/scribus/scribus.cpp (original)
+++ branches/Version15x/Scribus/scribus/scribus.cpp Fri Mar 18 22:52:42 2022
@@ -2854,21 +2854,21 @@
scrRecentPasteActions.clear();
int max = qMin(m_prefsManager.appPrefs.scrapbookPrefs.numScrapbookCopies, scrapbookPalette->tempBView->objectMap.count());
- if (max > 0)
- {
- auto it = scrapbookPalette->tempBView->objectMap.end();
- QString strippedName;
- for (int m = 0; m < max; ++m)
- {
- it--;
- strippedName = it.key();
- QPixmap pm = it.value().Preview;
- scrRecentPasteActions.insert(strippedName, new ScrAction(ScrAction::RecentPaste, pm, QString(), QString("&%1 %2").arg(m+1).arg(strippedName), QKeySequence(), this, it.key()));
- connect( scrRecentPasteActions[strippedName], SIGNAL(triggeredData(QString)), this, SLOT(pasteRecent(QString)) );
- scrMenuMgr->addMenuItemString(strippedName, "EditPasteRecent");
- }
- scrMenuMgr->addMenuItemStringsToRememberedMenu("EditPasteRecent", scrRecentPasteActions);
- }
+ if (max <= 0)
+ return;
+
+ auto it = scrapbookPalette->tempBView->objectMap.end();
+ QString strippedName;
+ for (int i = 0; i < max; ++i)
+ {
+ it--;
+ strippedName = it.key();
+ QPixmap pm = it.value().Preview;
+ scrRecentPasteActions.insert(strippedName, new ScrAction(ScrAction::RecentPaste, pm, QString(), QString("&%1 %2").arg(i + 1).arg(strippedName), QKeySequence(), this, it.key()));
+ connect( scrRecentPasteActions[strippedName], SIGNAL(triggeredData(QString)), this, SLOT(pasteRecent(QString)) );
+ scrMenuMgr->addMenuItemString(strippedName, "EditPasteRecent");
+ }
+ scrMenuMgr->addMenuItemStringsToRememberedMenu("EditPasteRecent", scrRecentPasteActions);
}
void ScribusMainWindow::rebuildScrapbookMenu()
@@ -7665,11 +7665,9 @@
//can select to eg apply to even pages with a single odd page selected
if (pageSelection == 1 && (pageNum %2 != 0)) //Even, %2!=0 as 1st page is numbered 0
Apply_MasterPage(masterPageName, pageNum, false);
- else
- if (pageSelection == 2 && (pageNum %2 == 0)) //Odd, %2==0 as 1st page is numbered 0
+ else if (pageSelection == 2 && (pageNum %2 == 0)) //Odd, %2==0 as 1st page is numbered 0
Apply_MasterPage(masterPageName, pageNum, false);
- else
- if (pageSelection == 3) //All
+ else if (pageSelection == 3) //All
Apply_MasterPage(masterPageName, pageNum, false);
}
}
@@ -9676,7 +9674,7 @@
editMDialog = (MarkInsert*) new Mark2Mark(doc->marksList(), mrk, this);
QString l = mrk->getDestMarkName();
MarkType t = mrk->getDestMarkType();
- Mark* m = doc->getMark(l,t);
+ Mark* m = doc->getMark(l, t);
editMDialog->setValues(mrk->label, m);
}
break;
More information about the scribus-commit
mailing list