r17965 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 17 13:14:17 UTC 2012


Author: jghali
Date: Mon Dec 17 13:14:17 2012
New Revision: 17965

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17965
Log: (empty)

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17965&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Mon Dec 17 13:14:17 2012
@@ -2095,11 +2095,12 @@
 		ItemInfo itemInfo;
 		m_Doc->setMasterPageMode(false);
 		
-		int ownPage = tAtt.valueAsInt("OwnPage");
+		//int ownPage = tAtt.valueAsInt("OwnPage");
 		success = readObject(doc, reader, itemInfo, baseDir, false);
 		if (!success) break;
 
-		itemInfo.item->OwnPage = ownPage;
+		// #11274 : OwnPage is not meaningful for pattern items
+		itemInfo.item->OwnPage = -1 /*ownPage*/;
 		itemInfo.item->OnMasterPage = "";
 
 		if (itemInfo.item->isTableItem)

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17965&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Mon Dec 17 13:14:17 2012
@@ -3990,11 +3990,11 @@
 		ItemInfo itemInfo;
 		m_Doc->setMasterPageMode(false);
 		
-		int ownPage = tAtt.valueAsInt("OwnPage");
+		//int ownPage = tAtt.valueAsInt("OwnPage");
 		success = readObject(doc, reader, itemInfo, baseDir, false);
 		if (!success) break;
 
-		itemInfo.item->OwnPage = ownPage;
+		itemInfo.item->OwnPage = -1 /*ownPage*/;
 		itemInfo.item->OnMasterPage = "";
 		if (isNewFormat)
 		{

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17965&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Dec 17 13:14:17 2012
@@ -10411,6 +10411,16 @@
 	pat.width = maxx - minx;
 	pat.height = maxy - miny;
 	pat.items.append(currItem);
+	// #11274 : OwnPage is not meaningful for pattern items
+	// We set consequently pattern item's OwnPage to -1 
+	QList<PageItem*> patternItems = pat.items;
+	while (patternItems.count() > 0)
+	{
+		PageItem* patItem = patternItems.takeAt(0);
+		if (patItem->isGroup())
+			patternItems += patItem->groupItemList;
+		patItem->OwnPage = -1;
+	}
 	if (doc->docPatterns.contains(patternName))
 		doc->docPatterns.remove(patternName);
 	doc->addPattern(patternName, pat);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17965&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Mon Dec 17 13:14:17 2012
@@ -5998,6 +5998,21 @@
 		currItem = it.value();
 		currItem->OwnPage = -1;
  	}
+
+	// #11274: Scribus crash when opening .sla document
+	// OwnPage is not meaningful for pattern items
+	QHash<QString, ScPattern>::iterator patternIt;
+	for (patternIt = docPatterns.begin(); patternIt != docPatterns.end(); ++patternIt)
+	{
+		QList<PageItem*> patternItems = patternIt->items;
+		while (patternItems.count() > 0)
+		{
+			PageItem* patItem = patternItems.takeAt(0);
+			if (patItem->isGroup())
+				patternItems += patItem->groupItemList;
+			patItem->OwnPage = -1;
+		}
+	}
 }
 
 




More information about the scribus-commit mailing list