r22279 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 26 02:13:52 UTC 2017


Author: jghali
Date: Tue Dec 26 02:13:51 2017
New Revision: 22279

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22279
Log:
#15080: Crash when editing document (round one)

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/text/storytext.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22279&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Tue Dec 26 02:13:51 2017
@@ -1304,6 +1304,8 @@
 			addPARSEP = false;
 		itemText.append(nxt->itemText);
 	}
+	else
+		addPARSEP = false;
 	NextBox = nxt;
 	nxt->BackBox = this;
 	// update AutoText

Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22279&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp	(original)
+++ trunk/Scribus/scribus/text/storytext.cpp	Tue Dec 26 02:13:51 2017
@@ -1768,16 +1768,23 @@
 	int start = it->preceding(pos + 1);
 	int end = it->next();
 	int wordLength = end - start;
-	select(start, wordLength);
+	if (wordLength > 0)
+		select(start, wordLength);
+	else
+	{
+		deselectAll();
+		setCursorPosition(start);
+	}
 	return start;
 }
 
 
 void StoryText::select(int pos, int len, bool on)
 {
-	Q_ASSERT(len>=0);
 	if (pos < 0)
 		pos += length();
+	if (len < 0)
+		len = 0;
 
 	assert( pos >= 0 );
 	assert( pos + signed(len) <= length() );




More information about the scribus-commit mailing list