r16798 by jghali - #10211: Undoing last page deletion crashes Scribus

scribus-commit scribus-commit at lists.scribus.net
Wed Aug 24 22:04:02 UTC 2011


Author: jghali
Date: Wed Aug 24 22:04:02 2011
New Revision: 16798

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16798
Log:
#10211: Undoing last page deletion crashes Scribus

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

Modified: branches/Version135/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16798&path=/branches/Version135/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribus.cpp (original)
+++ branches/Version135/Scribus/scribus/scribus.cpp Wed Aug 24 22:04:02 2011
@@ -5724,7 +5724,18 @@
 	undoManager->setUndoEnabled(false);
 
 	QStringList base;
-	if (basedOn == NULL)
+	if (basedOn != NULL)
+	{
+		base = *basedOn;
+		// #10211 case when restoring page deletion, basedOn contains only masterpage name
+		if (base.count() == 1)
+		{
+			int setcol = doc->pageSets[doc->currentPageLayout].Columns;
+			while (base.count() < setcol)
+				base.append (base.at(0));
+		}
+	}
+	if (base.empty())
 	{
 		int setcol = doc->pageSets[doc->currentPageLayout].Columns;
 		if (setcol == 1)
@@ -5748,8 +5759,6 @@
 			base.append( CommonStrings::trMasterPageNormalRight);
 		}
 	}
-	else
-		base = *basedOn;
 	int cc;
 	int wot = wo;
 	if (where==0)




More information about the scribus-commit mailing list