r19374 by jghali - #12555: Undo 'delete single item in a group' does not restore regroup

scribus-commit scribus-commit at lists.scribus.net
Sat Jul 26 23:50:37 UTC 2014


Author: jghali
Date: Sat Jul 26 23:50:37 2014
New Revision: 19374

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19374
Log:
#12555: Undo 'delete single item in a group' does not restore regroup

Modified:
    trunk/Scribus/scribus/scpage.cpp
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19374&path=/trunk/Scribus/scribus/scpage.cpp
==============================================================================
--- trunk/Scribus/scribus/scpage.cpp (original)
+++ trunk/Scribus/scribus/scpage.cpp Sat Jul 26 23:50:37 2014
@@ -363,7 +363,7 @@
 	if (itemList.count() <= 0) 
 		return;
 	m_Doc->view()->Deselect(true);
-	bool oldMPMode=m_Doc->masterPageMode();
+	bool oldMPMode = m_Doc->masterPageMode();
 	m_Doc->setMasterPageMode(!itemList.at(0)->OnMasterPage.isEmpty());
 	if (m_Doc->appMode == modeEditClip) // switch off from edit shape
 		m_Doc->scMW()->nodePalette->EndEdit();
@@ -372,7 +372,10 @@
 	{
 		//CB #3373 reinsert at old position and renumber items
 		PageItem* ite = itemList.at(id2);
-		m_Doc->Items->insert(id, ite);
+		if (ite->Parent && ite->Parent->isGroup())
+			ite->Parent->asGroupFrame()->groupItemList.insert(id, ite);
+		else
+			m_Doc->Items->insert(id, ite);
 		for (int i = 0; i < itemList.count(); ++i)
 		{
 			PageItem* ite = itemList.at(i);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19374&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Jul 26 23:50:37 2014
@@ -11761,16 +11761,6 @@
 				offs++;
 				continue;
 			}
-			else
-			{
-				itemList = GroupOfItem(Items, currItem);
-				if (itemList == NULL)
-				{
-					itemList = Items;
-					offs++;
-					continue;
-				}
-			}
 		}
 		//CB FIXME remove this and include of storyeditor.h too
 		if ((currItem->asTextFrame() || currItem->asPathText()) && currItem==m_ScMW->storyEditor->currentItem() && this==m_ScMW->storyEditor->currentDocument())
@@ -11807,16 +11797,19 @@
 		itemSelection->delaySignalsOff();
 		return;
 	}
-	selectedItemCount = delItems.count();
 
 	UndoTransaction* activeTransaction = NULL;
 	if (UndoManager::undoEnabled()) //always create transaction or check if item is reference for any mark or contains any mark or is welded etc
 		activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::Group + "/" + Um::Selection, Um::IGroup,
 																			  Um::Delete, tooltip, Um::IDelete));
-
+	
+	selectedItemCount = delItems.count();
 	for (uint de = 0; de < selectedItemCount; ++de)
 	{
 		currItem = delItems.at(selectedItemCount - (de + 1));
+		itemList = GroupOfItem(Items, currItem);
+		if (itemList == NULL)
+			continue;
 		if ((currItem->asImageFrame()) && ((ScCore->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PictureIsAvailable)))
 			ScCore->fileWatcher->removeFile(currItem->Pfile);
 		//delete marks pointed to that item
@@ -17712,7 +17705,7 @@
 	//used by MarksManager
 	if (UndoManager::undoEnabled())
 	{
-		ScItemsState* ims = new ScItemsState(Um::DeleteMark,"",Um::IDelete);
+		ScItemsState* ims = new ScItemsState(Um::DeleteMark, "", Um::IDelete);
 		if (mrk->isUnique())
 		{
 			ims->set("MARK", QString("delete"));




More information about the scribus-commit mailing list