r15200 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:48 CEST 2010


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

Changeset: 
M  /trunk/Scribus/scribus/pageitem_textframe.cpp
M  /trunk/Scribus/scribus/ui/storyeditor.cpp

Diffs:
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 15199)
+++ scribus/pageitem_textframe.cpp	(revision 15200)
@@ -2401,7 +2401,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);
@@ -2462,7 +2462,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));
Index: scribus/ui/storyeditor.cpp
===================================================================
--- scribus/ui/storyeditor.cpp	(revision 15199)
+++ scribus/ui/storyeditor.cpp	(revision 15200)
@@ -2888,6 +2888,8 @@
 	}
 #endif
 	Editor->saveItemText(nextItem);
+	nextItem->invalidateLayout();
+	nextItem->layout();
 #if 0
 	QList<PageItem*> FrameItemsDel;
 	FrameItemsDel.setAutoDelete(true);




More information about the scribus-commit mailing list