r21495 by jghali - #14354: Crash when linking empty text chain to non empty text chain

scribus-commit scribus-commit at lists.scribus.net
Sun Nov 6 08:58:12 UTC 2016


Author: jghali
Date: Sun Nov  6 08:58:12 2016
New Revision: 21495

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21495
Log:
#14354: Crash when linking empty text chain to non empty text chain

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21495&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Sun Nov  6 08:58:12 2016
@@ -1339,6 +1339,12 @@
 		}
 	}
 	invalid = true;
+	PageItem* prev = this;
+	while (prev->BackBox && !prev->BackBox->frameOverflows())
+	{
+		prev->BackBox->invalid = true;
+		prev = prev->BackBox;
+	}
 	while (nxt)
 	{
 		nxt->itemText = itemText;

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21495&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Sun Nov  6 08:58:12 2016
@@ -1306,11 +1306,14 @@
 	//fast validate empty frames
 	if (itLen == 0 || firstInFrame() == itLen)
 	{
-		PageItem* next = this;
+		PageItem_TextFrame * next = this;
 		while (next != NULL)
 		{
 			next->invalid = false;
-			next = next->nextInChain();
+			next->firstChar = itLen;
+			next->MaxChars = itLen;
+			next->textLayout.clear();
+			next = dynamic_cast<PageItem_TextFrame*>(next->nextInChain());
 		}
 		// TODO layout() shouldn't delete any frame here, as it breaks any loop
 		// over the doc->Items or doc->MasterItems lists when done with indexes




More information about the scribus-commit mailing list