r19413 by jghali - #12590: Undo/Redo may create ghost entries in Outline palette deleting Layers

scribus-commit scribus-commit at lists.scribus.net
Wed Aug 6 11:57:10 UTC 2014


Author: jghali
Date: Wed Aug  6 11:57:10 2014
New Revision: 19413

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19413
Log:
#12590: Undo/Redo may create ghost entries in Outline palette deleting Layers

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/ui/layers.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19413&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Wed Aug  6 11:57:10 2014
@@ -2942,6 +2942,8 @@
 		ss->set("LAYER_NR", ll->ID);
 		undoManager->action(this, ss, DocName, Um::ILayer);
 	}
+
+	changed();
 	return lId;
 }
 
@@ -2966,6 +2968,7 @@
 		ss.ReadElemToLayer(dataS, appPrefsData.fontPrefs.AvailFonts, this, Pages->at(0)->xOffset(), Pages->at(0)->yOffset(), false, true, appPrefsData.fontPrefs.GFontSub, whereToInsert);
 	}
 	sourceSelection.clear();
+	changed();
 }
 
 
@@ -2986,48 +2989,6 @@
 	if (ScCore->usingGUI())
 		removeLayer(layerID, deleteItems);
 
-	/*
-	//Layer found, do we want to delete its items too?
-	if (masterPageMode)
-		MasterPages = Pages;
-	else
-		DocPages = Pages;
-	for (uint b = 0; b < MasterItems.count(); ++b)
-	{
-		if (MasterItems.at(b)->LayerID == layerID)
-		{
-			if (deleteItems)
-			{
-				MasterItems.at(b)->setTagged(true);
-				MasterItems.at(b)->setLocked(false);
-			}
-			else
-				MasterItems.at(b)->setTagged(false);
-		}
-	}
-//	if (view->SelItem.count() != 0)
-//		view->DeleteItem();
-//	view->SelItem.clear();
-	for (uint b = 0; b < DocItems.count(); ++b)
-	{
-		if (DocItems.at(b)->LayerID == l)
-		{
-			if (deleteItems)
-			{
-				DocItems.at(b)->setTagged(true);
-				DocItems.at(b)->setLocked(false);
-			}
-			else
-				DocItems.at(b)->setLayer(0);
-		}
-	}
-//	if (view->SelItem.count() != 0)
-//		view->DeleteItem();
-
-	bool deletedOk=deleteTaggedItems();
-	Q_ASSERT(deletedOk);
-
-	*/
 	//Now delete the layer
 	Layers.removeLayerByID(layerID);
 
@@ -3045,7 +3006,8 @@
 		delete activeTransaction;
 		activeTransaction = NULL;
 	}
-//	setActiveLayer(layerIDFromLevel(0));
+
+	changed();
 	return true;
 }
 

Modified: trunk/Scribus/scribus/ui/layers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19413&path=/trunk/Scribus/scribus/ui/layers.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/layers.cpp (original)
+++ trunk/Scribus/scribus/ui/layers.cpp Wed Aug  6 11:57:10 2014
@@ -274,7 +274,6 @@
 	rebuildList();
 	markActiveLayer();
 	m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
-	m_Doc->changed();
 }
 
 void LayerPalette::dupLayer()
@@ -292,8 +291,7 @@
 	markActiveLayer();
 	m_Doc->copyLayer(current, m_Doc->activeLayer());
 	m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
-	m_Doc->changed();
-	if(copyTransaction)
+	if (copyTransaction)
 	{
 		copyTransaction->commit();
 		delete copyTransaction;
@@ -327,7 +325,6 @@
 	rebuildList();
 	markActiveLayer();
 	m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
-	m_Doc->changed();
 }
 
 void LayerPalette::upLayer()




More information about the scribus-commit mailing list