[gnumeric] Fix undo of object creation followed by duplication. [#623566]



commit d25359804a80df2906bbca1543c0de181d35b127
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Jul 5 00:21:50 2010 -0600

    Fix undo of object creation followed by duplication. [#623566]
    
    2010-07-05  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/sheet-control-gui.c (scg_drag_receive_same_process): one need to
    	  first duplicate the sheet before committing that change

 ChangeLog               |    5 +++++
 NEWS                    |    1 +
 src/sheet-control-gui.c |    5 +++--
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6c601e6..a62b63e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-05  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/sheet-control-gui.c (scg_drag_receive_same_process): one need to 
+	  first duplicate the sheet before committing that change
+
 2010-07-04  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/commands.c (cmd_objects_move): simplify
diff --git a/NEWS b/NEWS
index eeb6b70..2a02936 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Andreas:
 	* Fix ngettext usage.
 	* Fix undo text for sheet object duplication. [#623557]
 	* Fix additional undo entry for sheet object duplication. [#623559]
+	* Fix undo of object creation followed by duplication. [#623566]
 
 Morten:
 	* Ask user to locate solver binaries when plain search fails.
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 26634e5..b57890d 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -3581,7 +3581,6 @@ scg_drag_receive_same_process (SheetControlGUI *scg, GtkWidget *source_widget,
 				       (mask & GDK_SHIFT_MASK) != 0);
 		pane->drag.origin_x = pane->drag.last_x;
 		pane->drag.origin_y = pane->drag.last_y;
-		scg_objects_drag_commit	(scg, 8, make_dup, &undo, &redo, &title);
 
 		if (make_dup) {
 			GSList *ptr, *objs = go_hash_keys (scg->selected_objects);
@@ -3599,13 +3598,15 @@ scg_drag_receive_same_process (SheetControlGUI *scg, GtkWidget *source_widget,
 				}
 			}
 			g_slist_free (objs);
+			scg_objects_drag_commit	(scg, 8, TRUE, &undo, &redo, &title);
 			dx = x - origin_x;
 			dy = y - origin_y;
 			scg_objects_drag (scg, pane, NULL, &dx, &dy, 8, FALSE, FALSE, FALSE);
 			scg_objects_drag_commit (scg, 8, FALSE, &nudge_undo, &nudge_redo, NULL);
 			undo = go_undo_combine (undo, nudge_undo);
 			redo = go_undo_combine (nudge_redo, redo);
-		}
+		} else
+			scg_objects_drag_commit	(scg, 8, FALSE, &undo, &redo, &title);
 		cmd_generic (WORKBOOK_CONTROL (scg_wbcg (scg)), title, undo, redo);
 		g_free (title);
 	} else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]