r16772 by fschmid - Add some sanity checks when grouping objects.

scribus-commit scribus-commit at lists.scribus.net
Mon Aug 8 18:20:21 UTC 2011


Author: fschmid
Date: Mon Aug  8 18:20:21 2011
New Revision: 16772

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16772
Log:
Add some sanity checks when grouping objects.

Modified:
    trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
    trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16772&path=/trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp Mon Aug  8 18:20:21 2011
@@ -63,6 +63,7 @@
 	m_Doc=doc;
 	importerFlags = flags;
 	interactive = (flags & LoadSavePlugin::lfInteractive);
+	progressDialog = NULL;
 }
 
 QImage DrwPlug::readThumbnail(QString fName)
@@ -1221,12 +1222,18 @@
 						popped.groupItem->groupItemList.append(item);
 						item->gXpos = item->xPos() - popped.groupItem->xPos();
 						item->gYpos = item->yPos() - popped.groupItem->yPos();
+						if (groupStack.count() > 0)
+							groupStack.top().GElements.removeAll(tmpSel->itemAt(i));
+						Elements.removeAll(tmpSel->itemAt(i));
+						m_Doc->Items->removeAll(tmpSel->itemAt(i));
 					}
 					if (popped.itemGroupName.isEmpty())
 						popped.groupItem->setItemName( tr("Group%1").arg(m_Doc->GroupCounter));
 					else
 						popped.groupItem->setItemName(popped.itemGroupName);
 					popped.groupItem->AutoName = false;
+					popped.groupItem->groupWidth = tmpSel->width();
+					popped.groupItem->groupHeight = tmpSel->height();
 				}
 				m_Doc->GroupCounter++;
 				tmpSel->clear();

Modified: trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16772&path=/trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp Mon Aug  8 18:20:21 2011
@@ -56,6 +56,7 @@
 	m_Doc=doc;
 	importerFlags = flags;
 	interactive = (flags & LoadSavePlugin::lfInteractive);
+	progressDialog = NULL;
 }
 
 QImage XfigPlug::readThumbnail(QString fName)

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16772&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Mon Aug  8 18:20:21 2011
@@ -12275,7 +12275,10 @@
 	{
 		currItem = itemSelection->itemAt(c);
 		int d = Items->indexOf(currItem);
-		groupItem->groupItemList.append(Items->takeAt(d));
+		if (d >= 0)
+			groupItem->groupItemList.append(Items->takeAt(d));
+		else
+			groupItem->groupItemList.append(currItem);
 	}
 	groupItem->asGroupFrame()->adjustXYPosition();
 	renumberItemsInListOrder();
@@ -12326,7 +12329,10 @@
 	{
 		currItem = itemList.at(c);
 		int d = Items->indexOf(currItem);
-		groupItem->groupItemList.append(Items->takeAt(d));
+		if (d >= 0)
+			groupItem->groupItemList.append(Items->takeAt(d));
+		else
+			groupItem->groupItemList.append(currItem);
 		currItem->gXpos = currItem->xPos() - minx;
 		currItem->gYpos = currItem->yPos() - miny;
 		currItem->gWidth = maxx - minx;
@@ -12366,7 +12372,10 @@
 	{
 		currItem = itemList.at(c);
 		int d = Items->indexOf(currItem);
-		groupItem->groupItemList.append(Items->takeAt(d));
+		if (d >= 0)
+			groupItem->groupItemList.append(Items->takeAt(d));
+		else
+			groupItem->groupItemList.append(currItem);
 		currItem->gXpos = currItem->xPos() - groupItem->xPos();
 		currItem->gYpos = currItem->yPos() - groupItem->yPos();
 		currItem->gWidth = maxx - minx;




More information about the scribus-commit mailing list