r19133 by craig - #12234: Fix undo/redo of line width changes, and tag item resizes with new undo tag to avoid undo finding the wrong things to restore/undo

scribus-commit scribus-commit at lists.scribus.net
Wed May 21 21:09:40 UTC 2014


Author: craig
Date: Wed May 21 21:09:39 2014
New Revision: 19133

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19133
Log:
#12234: Fix undo/redo of line width changes, and tag item resizes with new undo tag to avoid undo finding the wrong things to restore/undo

Modified:
    trunk/Scribus/scribus/pageitem.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19133&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Wed May 21 21:09:39 2014
@@ -4290,8 +4290,8 @@
 		SimpleState *ss = new SimpleState(Um::LineWidth,
 						QString(Um::FromTo).arg(m_lineWidth).arg(newWidth),Um::ILineStyle);
 		ss->set("LINE_WIDTH", "line_width");
-		ss->set("OLD_WIDTH", m_lineWidth);
-		ss->set("NEW_WIDTH", newWidth);
+		ss->set("OLD_LINEWIDTH", m_lineWidth);
+		ss->set("NEW_LINEWIDTH", newWidth);
 		undoManager->action(this, ss);
 	}
 	Oldm_lineWidth=m_lineWidth;
@@ -4810,6 +4810,7 @@
 		SimpleState *ss = new SimpleState(Um::Resize,
 						   QString(Um::ResizeFromTo).arg(oldWidth).arg(oldHeight).arg(m_width).arg(m_height),
 						           Um::IResize);
+		ss->set("ITEM_RESIZE", "item_resize");
 		if (!isNoteFrame() || !asNoteFrame()->isAutoWidth())
 		{
 			ss->set("OLD_WIDTH", oldWidth);
@@ -4955,7 +4956,8 @@
 			restoreStartArrowScale(ss, isUndo);
 		else if (ss->contains("IMAGE_ROTATION"))
 			restoreImageRotation(ss, isUndo);
-		else if (ss->contains("OLD_HEIGHT") || ss->contains("OLD_WIDTH"))
+//		else if (ss->contains("OLD_HEIGHT") || ss->contains("OLD_WIDTH"))
+		else if (ss->contains("ITEM_RESIZE"))
 			restoreResize(ss, isUndo);
 		else if (ss->contains("OLD_ROT"))
 			restoreRotate(ss, isUndo);
@@ -6763,9 +6765,9 @@
 
 void PageItem::restoreLineWidth(SimpleState *state, bool isUndo)
 {
-	double w = state->getDouble("OLD_WIDTH");
+	double w = state->getDouble("OLD_LINEWIDTH");
 	if (!isUndo)
-		w = state->getDouble("NEW_WIDTH");
+		w = state->getDouble("NEW_LINEWIDTH");
 	select();
 	m_Doc->itemSelection_SetLineWidth(w);
 }




More information about the scribus-commit mailing list