r17924 by fschmid - Fixed Bug #11220: Resize on ungroup

scribus-commit scribus-commit at lists.scribus.net
Sat Dec 1 09:57:41 UTC 2012


Author: fschmid
Date: Sat Dec  1 09:57:41 2012
New Revision: 17924

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17924
Log:
Fixed Bug #11220: Resize on ungroup

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17924&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Dec  1 09:57:41 2012
@@ -14900,7 +14900,7 @@
 		itemSelection->delaySignalsOn();
 		for (int b = 0; b < toDelete.count(); b++)
 		{
-			currItem = toDelete.at(b);
+		/*	currItem = toDelete.at(b);
 			QList<PageItem*> *list = Items;
 			list = parentGroup(currItem, Items);
 			int d = list->indexOf(currItem);
@@ -14925,6 +14925,11 @@
 			for (int a = 0; a < tempSelection.count(); ++a)
 			{
 				PageItem* rItem = tempSelection.itemAt(a);
+				if (rItem->isGroup())
+				{
+					rItem->groupWidth = rItem->width() / (currItem->width() / currItem->groupWidth);
+					rItem->groupHeight = rItem->height() / (currItem->height() / currItem->groupHeight);
+				}
 				n = FPoint(rItem->xPos() - currItem->xPos(), rItem->yPos() - currItem->yPos());
 				rItem->setXYPos(ma.m11() * n.x() + ma.m21() * n.y() + ma.dx(), ma.m22() * n.y() + ma.m12() * n.x() + ma.dy());
 				rItem->rotateBy(currItem->rotation());
@@ -14969,8 +14974,8 @@
 			}
 
 			tempSelection.clear();
-			tempSelection.delaySignalsOff();
-		/*	currItem = toDelete.at(b);
+			tempSelection.delaySignalsOff();*/
+			currItem = toDelete.at(b);
 			QList<PageItem*> *list = Items;
 			list = parentGroup(currItem, Items);
 			int d = list->indexOf(currItem);
@@ -14982,14 +14987,26 @@
 				PageItem* gItem = currItem->groupItemList.last();
 				removeFromGroup(gItem);
 				if (currItem->Parent == NULL)
+				{
 					Items->insert(d, gItem);
+					gItem->OwnPage = OnPage(gItem);
+				}
 				else
 				{
 					addToGroup(currItem->Parent, gItem);
 					list->insert(d, gItem);
 				}
 				itemSelection->addItem(gItem);
-			} */
+			}
+			if(UndoManager::undoEnabled())
+			{
+				ScItemState<QList<QPointer<PageItem> > > *is = new ScItemState<QList<QPointer<PageItem> > >(UndoManager::Ungroup);
+				is->set("UNGROUP", "ungroup");
+				Selection tempSelection(this, false);
+				tempSelection.addItem(currItem,true);
+				is->setItem(tempSelection.selectionList());
+				undoManager->action(this, is);
+			}
 		}
 		setLoading(wasLoad);
 		itemSelection->delaySignalsOff();




More information about the scribus-commit mailing list