r25038 by craig - Backport potential crash fix

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 17 20:35:30 UTC 2022


Author: craig
Date: Thu Mar 17 20:35:30 2022
New Revision: 25038

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25038
Log:
Backport potential crash fix

Modified:
    branches/Version15x/Scribus/scribus/scribus.cpp

Modified: branches/Version15x/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25038&path=/branches/Version15x/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version15x/Scribus/scribus/scribus.cpp	(original)
+++ branches/Version15x/Scribus/scribus/scribus.cpp	Thu Mar 17 20:35:30 2022
@@ -2857,16 +2857,15 @@
 	if (max > 0)
 	{
 		auto it = scrapbookPalette->tempBView->objectMap.end();
-		it--;
 		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");
-			it--;
 		}
 		scrMenuMgr->addMenuItemStringsToRememberedMenu("EditPasteRecent", scrRecentPasteActions);
 	}




More information about the scribus-commit mailing list