r17787 by jghali - #11097: content disappear if a group object falls outside master page

scribus-commit scribus-commit at lists.scribus.net
Fri Oct 5 20:21:17 UTC 2012


Author: jghali
Date: Fri Oct  5 20:21:17 2012
New Revision: 17787

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17787
Log:
#11097: content disappear if a group object falls outside master page

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

Modified: branches/Version14x/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17787&path=/branches/Version14x/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribusdoc.cpp Fri Oct  5 20:21:17 2012
@@ -4487,6 +4487,32 @@
 		currItem = FrameItems.at(i);
 		currItem->OwnPage = -1;
  	}
+
+	// #11097 : we have a bug if an object inside a group fall outside masterpage
+	QMap<int, PageItem*> groupControls;
+	for (int i = 0; i < MasterItems.count(); ++i)
+	{
+		currItem = MasterItems.at(i);
+		if (currItem->isGroupControl)
+		{
+			int first = currItem->Groups.first();
+			groupControls[first] = currItem;
+		}
+		if (currItem->OwnPage == -1 && currItem->Groups.count() > 0)
+		{
+			int top = currItem->Groups.top();
+			PageItem* groupControl = groupControls.value(top, 0);
+			while (groupControl)
+			{
+				currItem->OwnPage = groupControl->OwnPage;
+				if (currItem->OwnPage >= 0 || groupControl->Groups.count() <= 1)
+					break;
+				int groupIndex = groupControl->Groups.count() - 2;
+				int groupID  = groupControl->Groups.at(groupIndex);
+				groupControl = groupControls.value(groupID, 0);
+			}
+		}
+	}
 }
 
 




More information about the scribus-commit mailing list