r17359 by jghali - #10618: crash on ungrouping table

scribus-commit scribus-commit at lists.scribus.net
Tue Mar 6 21:36:49 UTC 2012


Author: jghali
Date: Tue Mar  6 21:36:48 2012
New Revision: 17359

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17359
Log:
#10618: crash on ungrouping table

Modified:
    branches/Version14x/Scribus/scribus/canvasmode_create.cpp

Modified: branches/Version14x/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17359&path=/branches/Version14x/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/canvasmode_create.cpp (original)
+++ branches/Version14x/Scribus/scribus/canvasmode_create.cpp Tue Mar  6 21:36:48 2012
@@ -464,11 +464,25 @@
 void CreateMode::SetupDrawNoResize(int nr)
 {
 	PageItem* currItem = m_doc->Items->at(nr);
-	//	currItem->setFont(Doc->toolSettings.defFont);
-	//	currItem->setFontSize(Doc->toolSettings.defSize);
 	m_doc->m_Selection->delaySignalsOn();
 	m_doc->m_Selection->clear();
 	m_doc->m_Selection->addItem(currItem);
+	// #10618 : Select table items if needed otherwise
+	// a crash will be triggered if user tries to ungroup
+	if (currItem->Groups.count() > 0)
+	{
+		for (int i = 0; i < m_doc->Items->count(); ++i)
+		{
+			PageItem* item = m_doc->Items->at(i);
+			if (item->Groups.count() == 0)
+				continue;
+			if (item->Groups.top() != currItem->Groups.top())
+				continue;
+			if (item->ItemNr != currItem->ItemNr)
+				m_doc->m_Selection->addItem(item, true);
+			item->isSingleSel = false;
+		}
+	}
 	m_doc->m_Selection->delaySignalsOff();
 //	emit DocChanged();
 	currItem->Sizing =  false /*currItem->asLine() ? false : true*/;




More information about the scribus-commit mailing list