r18585 by fschmid - Fixed Bug #11821: grouped groups : ungrouping crashes when empty

scribus-commit scribus-commit at lists.scribus.net
Tue Nov 5 17:20:54 UTC 2013


Author: fschmid
Date: Tue Nov  5 17:20:54 2013
New Revision: 18585

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18585
Log:
Fixed Bug #11821: grouped groups : ungrouping crashes when empty

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18585&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue Nov  5 17:20:54 2013
@@ -15188,7 +15188,8 @@
 		QList<PageItem*> *list = Items;
 		list = parentGroup(currItem, Items);
 		int d = list->indexOf(currItem);
-		list->removeAt(d);
+		if (d >= 0)
+			list->removeAt(d);
 		itemSelection->removeItem(currItem);
 		int gcount = currItem->groupItemList.count();
 		for (int c = 0; c < gcount; c++)
@@ -15250,7 +15251,8 @@
 	itemSelection->connectItemToGUI();
 	itemSelection->getGroupRect(&x, &y, &w, &h);
 	emit docChanged();
-	m_ScMW->HaveNewSel(itemSelection->itemAt(0)->itemType());
+	if (itemSelection->count() > 0)
+		m_ScMW->HaveNewSel(itemSelection->itemAt(0)->itemType());
 	regionsChanged()->update(QRectF(x-5, y-5, w+10, h+10));
 }
 




More information about the scribus-commit mailing list