Bug 107512 - Undo cut/delete of image with caption frame does not restore image
Summary: Undo cut/delete of image with caption frame does not restore image
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.2.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0 target:5.3.4
Keywords: bibisected, bisected
Depends on:
Blocks: Undo-Redo
  Show dependency treegraph
 
Reported: 2017-04-28 19:55 UTC by Eld0r
Modified: 2017-05-16 09:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
standalone example (21.01 KB, application/vnd.oasis.opendocument.text)
2017-05-04 12:41 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eld0r 2017-04-28 19:55:41 UTC
Description:
Undo or Redo of pictures inside caption frames don't restore the image itself.
The caption frame is restored but no image.
But it is possible to cut and paste the whole thing...

Steps to Reproduce:
1. Method delete:
2.  Paste a picture
3.  Insert caption
4.  Delete the picture
5.  Undo
6.  -> No picture

7.Method delete:
8.  Paste a picture
9.  Insert caption
10.  Cut the caption + pictue
11.  paste wherever in document
12.  Undo paste and undo cut
13.  -> No picture


Actual Results:  
picture is misson. 
undo/redo does not restore pictures inside caption frame.

Expected Results:
undo/redo should restore deleted pictures with captions


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36
Comment 1 Telesto 2017-04-29 14:03:20 UTC
Confirming with:
Version: 5.4.0.0.alpha0+
Build ID: 597a2f5d5bd37443262b0775b8439bc3502aef1b
CPU threads: 4; OS: Windows 6.2; UI render: GL; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2017-04-26_22:29:37
Locale: nl-NL (nl_NL); Calc: CL

but not with
Versie: 5.2.4.2 
Build ID: 3d5603e1122f0f102b62521720ab13a38a4e0eb0
CPU Threads: 4; Versie besturingssysteem:Windows 6.2; UI Render: GL; 
Locale: nl-NL (nl_NL); Calc: CL

Another one:
1. Paste a picture
2. Insert caption
3. Undo insert caption (CRTL+Z)
4. Redo Insert caption (CTRL+Y)
Comment 2 Eld0r 2017-04-29 19:08:04 UTC
Additional info:

My document shows more than 25 MiB, but my big pictures are missing under point Images in the Navigator.
Looks like the bits are somewhere in the document as dead code...


About LibreOffice:

Version: 5.3.2.2
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; Layout Engine: new; 
Locale: de-DE (de_DE); Calc: group
Comment 3 Eld0r 2017-05-02 08:26:17 UTC
(In reply to Eld0r from comment #2)
> Additional info:
> 
> My document shows more than 25 MiB, but my big pictures are missing under
> point Images in the Navigator.
> Looks like the bits are somewhere in the document as dead code...
> 

I just realized, that my images are PNGs with sizes below 10 KiB.
Resulting in a overall filesize of 102 KiB for this new document with copied text. INCLUDING the images. This info may help or not.
Comment 4 raal 2017-05-03 21:27:07 UTC
This seems to have begun at the below commit.
Adding Cc: to Caolán McNamara ; Could you possibly take a look at this one?
Thanks
 adfd5d29476d56c658d7780c6f7e5c952a4d7e8e is the first bad commit
commit adfd5d29476d56c658d7780c6f7e5c952a4d7e8e
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Thu Oct 27 23:09:56 2016 +0200

    source feedd45ba2dd308af2d3a1b2f64681b9467535b6

author	Caolán McNamara <caolanm@redhat.com>	2016-10-27 13:37:03 (GMT)
committer	Caolán McNamara <caolanm@redhat.com>	2016-10-27 13:37:03 (GMT)
commit feedd45ba2dd308af2d3a1b2f64681b9467535b6 (patch)
tree e513616af72c8b0effd4b57eb1b1744828153d78
parent f6ff0c237bde50d1fab6b19d87000038b6f3f042 (diff)
in msword the hard-break between image and caption has a width
Comment 5 Caolán McNamara 2017-05-04 12:41:25 UTC
Created attachment 133070 [details]
standalone example

I think the underlying problem precedes this, e.g. in this example, ctrl+a, del and undo and the hidden property after the image seems to be set across the image
Comment 6 Commit Notification 2017-05-10 16:04:19 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=771d85baf18e5b503eb6248e1f41928b00265d8d

tdf#107512 sw: fix rollback of text attributes in SwUndoDelete

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Michael Stahl (allotropia) 2017-05-10 16:19:50 UTC
yeah arguably this bug isn't a regression, it just got much more important due to new usage of hidden text triggering this start-of-paragraph corner case

fixed on master
Comment 8 Commit Notification 2017-05-16 09:58:41 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4820c9b981e060a55b3511272824dca7c2eb67d5&h=libreoffice-5-3

tdf#107512 sw: fix rollback of text attributes in SwUndoDelete

It will be available in 5.3.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.