r16542 by jghali - #9896 : crash when layouting very long text chain
scribus-commit
scribus-commit at lists.scribus.net
Thu Mar 31 23:09:28 CEST 2011
Author: jghali
Date: Thu Mar 31 21:09:28 2011
New Revision: 16542
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16542
Log:
#9896 : crash when layouting very long text chain
Modified:
branches/Version135/Scribus/scribus/pageitem_textframe.cpp
Modified: branches/Version135/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16542&path=/branches/Version135/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/pageitem_textframe.cpp (original)
+++ branches/Version135/Scribus/scribus/pageitem_textframe.cpp Thu Mar 31 21:09:28 2011
@@ -927,10 +927,14 @@
// qDebug("textframe: len=%d, going back", itemText.length());
invalid = false;
PageItem_TextFrame* prevInChain = dynamic_cast<PageItem_TextFrame*>(BackBox);
- if (!prevInChain)
- qDebug() << QString("layout(): backBox=%1 is no textframe!!").arg((ulong)BackBox);
- else
- BackBox->layout();
+ while (prevInChain && prevInChain->invalid)
+ {
+ if (!prevInChain->BackBox || !prevInChain->BackBox->invalid)
+ break;
+ prevInChain = dynamic_cast<PageItem_TextFrame*>(prevInChain->BackBox);
+ }
+ if (prevInChain && prevInChain->invalid)
+ prevInChain->layout();
// #9592 : warning, BackBox->layout() may not layout BackBox next box
if (!invalid)
return;
More information about the scribus-commit
mailing list