r19209 by jghali - #12363: Undo/Redo crashes Scribus undoing a Group if Windows > Outline is opened

scribus-commit scribus-commit at lists.scribus.net
Wed Jun 11 22:16:25 UTC 2014


Author: jghali
Date: Wed Jun 11 22:16:25 2014
New Revision: 19209

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19209
Log:
#12363: Undo/Redo crashes Scribus undoing a Group if Windows > Outline is opened

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19209&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Wed Jun 11 22:16:25 2014
@@ -2352,19 +2352,23 @@
 	double x, y, w, h;
 	ScItemState<QList<QPointer<PageItem> > > *is = dynamic_cast<ScItemState<QList<QPointer<PageItem> > >*>(state);
 	QList<QPointer<PageItem> > select = is->getItem();
-	m_Selection->setGroupRect();
-	m_Selection->getGroupRect(&x, &y, &w, &h);
 	m_Selection->delaySignalsOn();
-	Selection tempSelect(this,false);
-	if(isUndo)
+	for (int i = 0; i < select.count(); ++i)
+		m_Selection->removeItem(select.at(i));
+	Selection tempSelect(this, false);
+	if (isUndo)
 	{
 		tempSelect.addItem(select.last());
+		tempSelect.setGroupRect();
+		tempSelect.getGroupRect(&x, &y, &w, &h);
 		itemSelection_UnGroupObjects(&tempSelect);
 	}
 	else
 	{
 		for (int i = 0; i < select.size()-1; ++i)
 			tempSelect.addItem(select.at(i));
+		tempSelect.setGroupRect();
+		tempSelect.getGroupRect(&x, &y, &w, &h);
 		select.removeLast();
 		select.append(itemSelection_GroupObjects(false, false,&tempSelect));
 		is->setItem(select);




More information about the scribus-commit mailing list