r19131 by craig - Fix undo issue with new lorem ipsum placement

scribus-commit scribus-commit at lists.scribus.net
Wed May 21 19:16:36 UTC 2014


Author: craig
Date: Wed May 21 19:16:36 2014
New Revision: 19131

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19131
Log:
Fix undo issue with new lorem ipsum placement

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/ui/loremipsum.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19131&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Wed May 21 19:16:36 2014
@@ -4970,7 +4970,7 @@
 		else if (ss->contains("INSERT_FRAMETEXT"))
 			restoreInsertFrameText(ss,isUndo);
 		else if (ss->contains("LOREM_FRAMETEXT"))
-			restoreLoremIpsum(ss,isUndo);
+			restoreInsertFrameText(ss,isUndo);
 		else if (ss->contains("APPLY_CHARSTYLE"))
 			restoreCharStyle(ss,isUndo);
 		else if (ss->contains("SET_CHARSTYLE"))
@@ -6514,18 +6514,6 @@
 		itemText.setStyle(pos,is->getItem().second);
 	else
 		itemText.setStyle(pos,is->getItem().first);
-}
-
-void PageItem::restoreLoremIpsum(SimpleState *ss, bool isUndo)
-{
-	QString sampleText = ss->get("TEXT_STR");
-	if (isUndo)
-	{
-		itemText.selectAll();
-		asTextFrame()->deleteSelectedTextFromFrame();
-	}
-	else
-		itemText.insertChars(0,sampleText);
 }
 
 void PageItem::restoreDeleteFrameText(SimpleState *ss, bool isUndo)

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19131&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Wed May 21 19:16:36 2014
@@ -1554,7 +1554,6 @@
 	void restoreLineTP(SimpleState *state, bool isUndo);
 	void restoreLineWidth(SimpleState *state, bool isUndo);
 	void restoreLinkTextFrame(UndoState *state, bool isUndo);
-	void restoreLoremIpsum(SimpleState *state, bool isUndo);
 	void restoreMarkString(SimpleState *state, bool isUndo);
 	void restoreMaskGradient(SimpleState *state, bool isUndo);
 	void restoreMaskType(SimpleState *state,bool isUndo);

Modified: trunk/Scribus/scribus/ui/loremipsum.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19131&path=/trunk/Scribus/scribus/ui/loremipsum.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/loremipsum.cpp (original)
+++ trunk/Scribus/scribus/ui/loremipsum.cpp Wed May 21 19:16:36 2014
@@ -331,7 +331,9 @@
 		{
 			SimpleState *ss = new SimpleState(Um::AddLoremIpsum,"",Um::ICreate);
 			ss->set("LOREM_FRAMETEXT", "lorem_frametext");
+			ss->set("ETEA", QString("insert_frametext"));
 			ss->set("TEXT_STR",sampleText);
+			ss->set("START", i2->itemText.length());
 			undoManager->action(i2, ss);
 		}
 		if (activeTransaction)




More information about the scribus-commit mailing list