r17414 by jghali - #10658 : Deleting masterpage triggers crash

scribus-commit scribus-commit at lists.scribus.net
Tue Apr 3 20:49:23 UTC 2012


Author: jghali
Date: Tue Apr  3 20:49:23 2012
New Revision: 17414

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17414
Log:
#10658 : Deleting masterpage triggers crash

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

Modified: branches/Version14x/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17414&path=/branches/Version14x/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribusdoc.cpp Tue Apr  3 20:49:23 2012
@@ -1867,6 +1867,13 @@
 	Page* page = Pages->takeAt(pageNumber);
 	QString oldPageName(page->pageName());
 	delete page;
+	for (int i = 0; i < MasterPages.count(); ++i)
+		MasterPages.at(i)->setPageNr(i);
+	for (int i = 0; i < MasterItems.count(); ++i)
+	{
+		if (MasterItems.at(i)->OwnPage > pageNumber)
+			MasterItems.at(i)->OwnPage--;
+	}
 	// remove the master page from the master page name list
 	//MasterNames.remove(page->PageNam);
 	/*CB TODO moved back to muster.cpp for now as this must happen after reformPages




More information about the scribus-commit mailing list