r16107 by jghali - #9592, crash with sequential cutting of text : fix canvas part

scribus-commit scribus-commit at lists.scribus.net
Sat Dec 18 23:18:44 CET 2010


Author: jghali
Date: Sat Dec 18 22:18:44 2010
New Revision: 16107

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16107
Log:
#9592, crash with sequential cutting of text : fix canvas part

Modified:
    branches/Version135/Scribus/scribus/pageitem_textframe.cpp
    branches/Version135/Scribus/scribus/scribusview.cpp

Modified: branches/Version135/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16107&path=/branches/Version135/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/pageitem_textframe.cpp (original)
+++ branches/Version135/Scribus/scribus/pageitem_textframe.cpp Sat Dec 18 22:18:44 2010
@@ -925,7 +925,9 @@
 			qDebug() << QString("layout(): backBox=%1 is no textframe!!").arg((ulong)BackBox);
 		else 
 			BackBox->layout();
-		return;
+		// #9592 : warning, BackBox->layout() may not layout BackBox next box
+		if (!invalid)
+			return;
 	}
 	else if (!invalid && OnMasterPage.isEmpty()) {
 //		qDebug() << QString("textframe: len=%1, invalid=%2 OnMasterPage=%3: no relayout").arg(itemText.length()).arg(invalid).arg(OnMasterPage);

Modified: branches/Version135/Scribus/scribus/scribusview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16107&path=/branches/Version135/Scribus/scribus/scribusview.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusview.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusview.cpp Sat Dec 18 22:18:44 2010
@@ -1694,6 +1694,9 @@
 		FPoint pf(m_canvas->globalToCanvas(QPoint(x,y)));
 		if( m_canvas->frameHitTest(QPointF(pf.x(),pf.y()), currItem) == Canvas::INSIDE )
 		{
+			// #9592 : layout must be valid here, or screenToPosition() may crash
+			if (currItem->invalid)
+				currItem->layout();
 			if(currItem->reversed())
 			{ //handle Right to Left writing
 				FPoint point(currItem->width()-(pf.x() - currItem->xPos()), pf.y() - currItem->yPos());




More information about the scribus-commit mailing list