Bug 115655 - Collapsing a cell range with an image inside it makes the image disappear after saving and reloading
Summary: Collapsing a cell range with an image inside it makes the image disappear aft...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
4.2 all versions
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Regina Henschel
Keywords: bibisected, dataLoss, regression
Depends on:
Blocks: Calc-Images
  Show dependency treegraph
Reported: 2018-02-12 16:13 UTC by rh77
Modified: 2020-11-02 14:31 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:
Regression By:

Collapsing/Expanding image in grouped line - loosing image after repeated save to .ods (73.58 KB, image/png)
2018-02-20 08:37 UTC, rh77
After saving the file and reload it, the image is not lost (27.40 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-03-08 09:12 UTC, rh77
After saving the file and reload it, the image is lost (19.73 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-03-08 09:13 UTC, rh77

Note You need to log in before you can comment on or make changes to this bug.
Description rh77 2018-02-12 16:13:46 UTC
The steps:
1. Grouping a dataline (Data-->Grouping)
2. Sizing the grouped cell-height to 5cm
3. Insert an image "Insert Graphic" into the grouped cell
4. Collapsing and expanding the group + insided image ---> io.
5. Save the file to ods.
6. Reload the file
7. The image is lost

Please check and fix.

Steps to Reproduce:
1.show above

Actual Results:  

Expected Results:

Reproducible: Always

User Profile Reset: No

Additional Info:

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Comment 1 Imai 2018-02-19 08:44:58 UTC
Can you please explain more about Step3,4.
I couldn’t understand Step3:”Insert Graphic”(did you mean chart or image),and Step4.
Comment 2 rh77 2018-02-19 10:19:56 UTC
Step 3: Insert an image into a grouped cell (Menu->Insert->Image). I bind the image-position to a cell, not to a table-sheet. If the image-height is smaller as the collapsed-area, the image can be collapsing and expanding.

Step 4: If I collapsing/expanding the grouped dataline, the image disappears/appears. That's ok. But if I save the file to .ods and reload it, the image is lost.
Comment 3 Mohamed 2018-02-20 07:44:05 UTC
The problem of losing image didn't happen on my test. But when I followed the steps you mentioned to reproduce the bug, when collapsing/expanding the group it seem like the image is not inserted inside the grouped cell.

Version: (x64)
Build ID: 77a535285f0fd5f2464430abdc67cf99be024868
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-01-23_23:04:23
Locale: de-DE (de_DE); Calc: CL
Comment 4 rh77 2018-02-20 08:37:27 UTC
Created attachment 140011 [details]
Collapsing/Expanding image in grouped line - loosing image after repeated save to .ods
Comment 5 Buovjaga 2018-03-07 16:25:44 UTC
(In reply to rh77 from comment #0)
> 3. Insert an image "Insert Graphic" into the grouped cell

Please attach an example Calc document at this step.

Change back to UNCONFIRMED after you have provided the document.
Comment 6 rh77 2018-03-08 09:12:18 UTC
Created attachment 140464 [details]
After saving the file and reload it, the image is not lost
Comment 7 rh77 2018-03-08 09:13:03 UTC
Created attachment 140465 [details]
After saving the file and reload it, the image is lost
Comment 8 Buovjaga 2018-03-08 10:17:58 UTC
(In reply to rh77 from comment #6)
> Created attachment 140464 [details]
> After saving the file and reload it, the image is not lost

Repro disappearance after collapse, save & reload. 3.6 is not affected.

Arch Linux 64-bit
Build ID: 856c57f20f9b07c686a854e0ccbb6ee3b0ee4791
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 7th 2018

Arch Linux 64-bit
Version (Build ID: e183d5b)
Comment 9 raal 2018-03-09 18:09:22 UTC
 d34912b1eb89f5b0fde219ea57902f3a7d05cb7a is the first bad commit
commit d34912b1eb89f5b0fde219ea57902f3a7d05cb7a
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Fri Sep 18 10:34:06 2015 +0800

    Bibisect: This commit covers the following source commit(s) which failed to build
    commit 2b1aa949539d2fcbb3d349be3c279996630d83fc
    Author:     Noel Power <noel.power@suse.com>
    AuthorDate: Tue Feb 19 17:29:32 2013 +0000
    Commit:     Noel Power <noel.power@suse.com>
    CommitDate: Tue Feb 19 18:09:24 2013 +0000
        fdo#56276 - resize/reposition rotated shapes in a sensible way
        Change-Id: Ifa4f848da21838591daa1f57fb42dfd3f4fa8044
Comment 10 QA Administrators 2019-03-10 03:20:30 UTC Comment hidden (obsolete)
Comment 11 Xisco Faulí 2020-01-21 09:18:24 UTC
Still reproducible in

Build ID: b92293b3943423324064a8513c2e114d18817179
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

@Regina, since you fixed bug 119191, I thought you might be interested in this issue...
Comment 12 Regina Henschel 2020-01-22 23:03:21 UTC
(In reply to Xisco Faulí from comment #11)
> @Regina, since you fixed bug 119191, I thought you might be interested in
> this issue...

Yes, but I will not have much time in the next weeks.

Workaround: Do not anchor the image with "to cell (resize with cell)" but use "to cell".
If the row is resized to 0cm height because of collapsing, the image will resize to 0cm height too in case of anchor "to cell (resize with cell)".
When you reopen the collapsed version, you see in the Navigator, that the image still exists. Expand the group, then double-click the image entry in the Navigator to select the image. You should see some green handles. If you use the Position&Size dialog, it tells you a height of 0,01mm, if you use the Crop-dialog it tells you a height of 1%.

Errors which I see:
The image does not grow if the group is expanded.
If you use "Original size" from context menu, it does not set it to original size.
If you use the Crop-dialog and set Scale to 100%, the anchor moves to cell A1 and the image looses its position.
Comment 13 Regina Henschel 2020-09-26 17:52:18 UTC
Further problem: If you collapse the column, to which the image is anchored, the image is not hidden. So the behavior is inconsistent.

If the image size should be restored on setting the row to "show", then the size and position information of the images needs to be kept and written to file. Such would require a different method to 'hide' the image of a collapsed cell then setting its size to zero. I can image to use the layer "hidden" for that purpose. But that is a larger, principle change and therefore has to be discussed.
Comment 14 Regina Henschel 2020-10-21 17:38:32 UTC
I know what happens and will fix it together with other problems for cell anchored objects
Comment 15 Regina Henschel 2020-10-31 17:02:08 UTC
Should be fixed with https://cgit.freedesktop.org/libreoffice/core/commit/?id=1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca

(The patch covers several bug reports, therefore no automatic notification.)
Comment 16 Buovjaga 2020-11-02 14:31:46 UTC

Arch Linux 64-bit
Build ID: 2764c334c3b9cf428e4e7ab0c28ce6a34036fa77
CPU threads: 8; OS: Linux 5.9; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 2 November 2020