r14029 by jghali - #8443: layers are lost when a page is converted to a master page

scribus-commit scribus-commit at lists.scribus.net
Tue Sep 22 22:50:33 CEST 2009


Revision: 14029
Author: jghali
Date: 2009-09-22T20:48:37.810785Z
Commit message: #8443: layers are lost when a page is converted to a master page

Changeset: 
M  /trunk/Scribus/scribus/scribusdoc.cpp

Diffs:
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 14028)
+++ scribus/scribusdoc.cpp	(revision 14029)
@@ -3462,11 +3462,11 @@
 				int currActiveLayer = activeLayer();
 				for (ScLayers::iterator it = Layers.begin(); it != Layers.end(); ++it)
 				{
-					setActiveLayer((*it).ID);
+					setActiveLayer(it->ID);
 					for (uint ite = 0; ite < end2; ++ite)
 					{
 						PageItem *itemToCopy = MasterItems.at(ite);
-						if ((itemToCopy->OnMasterPage == pageMaster->pageName()) && ((*it).ID == itemToCopy->LayerID))
+						if ((itemToCopy->OnMasterPage == pageMaster->pageName()) && (it->ID == itemToCopy->LayerID))
 							tempSelection.addItem(itemToCopy, true);
 					}
 					if (tempSelection.count() != 0)
@@ -3475,7 +3475,7 @@
 						ScriXmlDoc *ss = new ScriXmlDoc();
 						QString dataS = ss->WriteElem(this, view(), &tempSelection);
 						setCurrentPage(targetPage);
-						ss->ReadElem(dataS, prefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, prefsData.fontPrefs.GFontSub, view());
+						ss->ReadElemToLayer(dataS, prefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, prefsData.fontPrefs.GFontSub, view(), it->ID);
 						delete ss;
 						setMasterPageMode(false);
 					}
@@ -3491,11 +3491,11 @@
 		int currActiveLayer = activeLayer();
 		for (ScLayers::iterator it = Layers.begin(); it != Layers.end(); ++it)
 		{
-			setActiveLayer((*it).ID);
+			setActiveLayer(it->ID);
 			for (uint ite = 0; ite < end; ++ite)
 			{
 				PageItem *itemToCopy = DocItems.at(ite);
-				if ((itemToCopy->OwnPage == static_cast<int>(sourcePage->pageNr())) && ((*it).ID == itemToCopy->LayerID))
+				if ((itemToCopy->OwnPage == static_cast<int>(sourcePage->pageNr())) && (it->ID == itemToCopy->LayerID))
 					tempSelection.addItem(itemToCopy, true);
 			}
 			if (tempSelection.count() != 0)
@@ -3504,7 +3504,7 @@
 				QString dataS = ss->WriteElem(this, view(), &tempSelection);
 				setMasterPageMode(true);
 				setCurrentPage(targetPage);
-				ss->ReadElem(dataS, prefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, prefsData.fontPrefs.GFontSub, view());
+				ss->ReadElemToLayer(dataS, prefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, prefsData.fontPrefs.GFontSub, view(), it->ID);
 				delete ss;
 				setMasterPageMode(false);
 			}




More information about the scribus-commit mailing list