r19677 by jghali - #12857 : Closing document while editing master pages may cause crash

scribus-commit scribus-commit at lists.scribus.net
Sun Dec 21 11:31:54 UTC 2014


Author: jghali
Date: Sun Dec 21 11:31:54 2014
New Revision: 19677

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19677
Log:
#12857 : Closing document while editing master pages may cause crash

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

Modified: branches/Version14x/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19677&path=/branches/Version14x/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribus.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribus.cpp Sun Dec 21 11:31:54 2014
@@ -8529,6 +8529,10 @@
 	pagePalette->enablePalette(true);
 	pagePalette->rebuildMasters();
 	ActWin->setMasterPagesPalette(NULL);
+	// #12857 : the number of pages may change when undoing/redoing
+	// page addition/deletion while in edit mode, so take some extra
+	// care so that storedPageNum is in appropriate range
+	storedPageNum = qMin(storedPageNum, doc->DocPages.count() - 1);
 	doc->setCurrentPage(doc->DocPages.at(storedPageNum));
 	view->reformPages(false);
 	view->setContentsPos(static_cast<int>(storedViewXCoor * storedViewScale), static_cast<int>(storedViewYCoor * storedViewScale));




More information about the scribus-commit mailing list