r15199 by jghali - #9180 : fix crash when selecting frame after modifying text in story editor

scribus-commit scribus-commit at lists.scribus.net
Wed Jun 16 22:00:26 CEST 2010


Revision: 15199
Author: jghali
Date: 2010-06-16T19:56:30.529143Z
Commit message: #9180 : fix crash when selecting frame after modifying text in story editor

Changeset: 
M  /branches/Version135/Scribus/scribus/pageitem_textframe.cpp
M  /branches/Version135/Scribus/scribus/storyeditor.cpp

Diffs:
Index: scribus/storyeditor.cpp
===================================================================
--- scribus/storyeditor.cpp	(revision 15198)
+++ scribus/storyeditor.cpp	(revision 15199)
@@ -2868,6 +2868,10 @@
 	}
 #endif
 	Editor->saveItemText(nextItem);
+	// #9180 : force relayout here, it appears that relayout is sometime disabled
+	// to speed up selection, but re layout() cannot be avoided here
+	nextItem->invalidateLayout();
+	nextItem->layout();
 #if 0
 	QList<PageItem*> FrameItemsDel;
 	FrameItemsDel.setAutoDelete(true);
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 15198)
+++ scribus/pageitem_textframe.cpp	(revision 15199)
@@ -2364,7 +2364,7 @@
 			bool previousWasObject(false);
 			double selX = ls.x;
 			ScText *hls = 0;
-			for (int as = ls.firstItem; as <= qMin(ls.lastItem, itemText.length()); ++as)
+			for (int as = ls.firstItem; as <= qMin(ls.lastItem, itemText.length() - 1); ++as)
 			{
 				bool selecteds = itemText.selected(as);
 				hls = itemText.item(as);
@@ -2424,7 +2424,7 @@
 
 			QColor tmp;
 			ScText *hl = 0;
-			for (int a = ls.firstItem; a <= qMin(ls.lastItem, itemText.length()); ++a)
+			for (int a = ls.firstItem; a <= qMin(ls.lastItem, itemText.length() - 1); ++a)
 			{
 				hl = itemText.item(a);
 				const CharStyle& charStyle(itemText.charStyle(a));




More information about the scribus-commit mailing list