After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 308300 - cmd_paste_copy_impl can't redo pasting sheet objects
cmd_paste_copy_impl can't redo pasting sheet objects
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2005-06-19 15:20 UTC by j.gnome
Modified: 2006-11-06 02:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description j.gnome 2005-06-19 15:20:38 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)
Comment 1 j.gnome 2005-06-19 15:27:55 UTC
Also can't undo pasting a graph.
Comment 2 Omi Azad 2005-07-06 16:36:28 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)

Well, the Undo works, but the last pased Image never disappear
Comment 3 Ivan Wong 2005-07-25 11:58:45 UTC
I can replicate this one on SID (1.5.2-1).
Comment 4 Jon Kåre Hellan 2006-10-29 11:34:35 UTC
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.
Comment 5 Jon Kåre Hellan 2006-11-01 21:07:57 UTC
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.
Comment 6 Morten Welinder 2006-11-03 01:58:59 UTC
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.
Comment 7 Morten Welinder 2006-11-05 01:48:46 UTC
Tentatively fixed in cvs HEAD.

Something seems to be up with redo, though, so I am keeping it open.
Comment 8 Morten Welinder 2006-11-06 01:21:38 UTC
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);
Comment 9 Morten Welinder 2006-11-06 02:01:20 UTC
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.