GNOME Bugzilla – Bug 308300
cmd_paste_copy_impl can't redo pasting sheet objects
Last modified: 2006-11-06 02:01:20 UTC
Windows XP, 1.5.2-rc1 1. Insert an image 2. Copy image to the clipboard 3. Paste (new image appears) 4. Undo (doesn't disappear)
Also can't undo pasting a graph.
>Windows XP, 1.5.2-rc1 >1. Insert an image >2. Copy image to the clipboard >3. Paste (new image appears) >4. Undo (doesn't disappear) Well, the Undo works, but the last pased Image never disappear
I can replicate this one on SID (1.5.2-1).
There is no undo for pasting graphs, or for pasting images from gnumeric. Pasting images from e.g. oowriter can be undone. Between gnumerics, sheet objects, i.e. graphs, images, etc. are passed as content type application/x-gnumeric. Pasting is handled by cmd_paste_copy. cmd_paste_copy has undo support for cell contents, but doesn't yet have undo support for sheet objects.
In order to undo sheet object pasting, cmd_paste_copy has to know which objects were added. clipboard_paste_region doesn't return this info.
How about {objects after} \ {objects before} ? That's a bit indirect, but doesn't require interface changes. sheet->sheet_objects has the list and you can use pointer equality.
Tentatively fixed in cvs HEAD. Something seems to be up with redo, though, so I am keeping it open.
Ok, there are a pile of problems for redo: 1. Only the initial "redo" pastes objects. Subsequent undos and redos do not. 2. If 1 is fixed, then the problem is that redo wants to paste what undo saved. That works for content, but not for objects: 2a. An object will typically not be entirely contained in the range and therefore skipped. 2b. There might be more objects that just those created by the command. 2c. The undo code I put in kills the objects a bit early. Fix for 1: /* Save the contents */ me->dst.paste_flags = PASTE_CONTENTS | (me->dst.paste_flags & PASTE_ALL_TYPES);
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.