r17940 by jghali - #11243: Crash when clearing content from a text frame if one of them is empty

scribus-commit scribus-commit at lists.scribus.net
Fri Dec 7 21:01:05 UTC 2012


Author: jghali
Date: Fri Dec  7 21:01:04 2012
New Revision: 17940

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17940
Log:
#11243: Crash when clearing content from a text frame if one of them is empty

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17940&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Fri Dec  7 21:01:04 2012
@@ -3823,6 +3823,9 @@
 
 void PageItem_TextFrame::clearContents()
 {
+	if (itemText.length() <= 0)
+		return;
+
 	PageItem *nextItem = this;
 	while (nextItem->prevInChain() != 0)
 		nextItem = nextItem->prevInChain();
@@ -4547,6 +4550,8 @@
 
 void PageItem_TextFrame::deleteSelectedTextFromFrame(/*bool findNotes*/)
 {
+	if (itemText.length() <= 0)
+		return;
 	if (itemText.lengthOfSelection() == 0)
 	{
 		itemText.select(itemText.cursorPosition(), 1);




More information about the scribus-commit mailing list