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...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2 all versions
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard:
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:


Attachments
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
Details
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
Details
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
Details

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
Description:
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: 6.1.0.0.alpha0+ (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.

Set to NEEDINFO.
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
Version: 6.1.0.0.alpha0+
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 3.6.7.2 (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

    source-hash-2b1aa949539d2fcbb3d349be3c279996630d83fc
    
    Bibisect: This commit covers the following source commit(s) which failed to build
    43682489c18c707bc0d5701f7f6a2df2511eeb0c
    88ed6d1348b5d3d517afcbe5fa1257d55625f39b
    fe8bcfa422c654e35ec22b5e3b1a512ae438b565
    5de206a7fbe74a7022bb3b20f190e6a3e6f1e3ae
    fb455e5013ab014058ad5f92238ef6fc91b2afcf
    a4c80756ca429ac3654455b5e6a6b6a700361b9a
    3a3254a900a6a8aad8d3321bf8b10d1770555cf5
    cac113602c8f60b7eaea8709f6670b00b0925447
    f8a75e4b225d3a998174f47066b9a72472546767
    1dace0c3e0972c2bde8db177433b7d095025bcca
    742515639168cd35a0c2036a5bf6c46b2a3a554e
    e70defefd80c44646a742ff581bca9b467b8e713
    396eb4f5cf8b37cd2a9f14d85764e03761ade19f
    f37df270f1a984f0a6138f4f22fc79a50e71dcc2
    349e9248f801d23735478abafe5328f79dfe4378
    bf46dfdb45b1d6cd99a5c729ee98df89db363225
    b8da61acb2bb887a7335a5db82b8b5ae1e0fab69
    a062799bd6902061895e19cace0099fadf696bb4
    95e6a0885e65cc57b11719cc0658be9d8b78fba9
    138e5a051805ca8a3b7e9626742cc475e3577cc4
    826cb27cc80ae843927d68e0337ad2caffa9f023
    bee8ed6772f420f9eefc57fee01da29ff466a8e9
    3998d1abb291309ddbbc2c9869736ebb1ea608f0
    a09f11715be53587ee2b0368e19f45cc85fb6cf1
    ef1d096ddc311a2fd821d4076421c4a8f8d63abf
    55dda63b297a287c9abc6ba2f19946817e8744e7
    5bdd1e9ee8f3ca9dc647998a8ec7b9415add01fe
    0db079cd5a09b3f24b0dd3563f100c77561ccfde
    eea3634b2bd85e7f290e0504da1b8906c7d33ca4
    49db90342f193f31500b2717cc27bdf2f25e2d95
    bcaa4cd4f3be07f9211b51da4d258b61423f1e28
    9e7f056bd08b18d084497b0846c7c8f31b82f58a
    f49b4581a0a5056a51712bcabcc66483a87a07c8
    0d05957cf0c38abab45030ba172025e4ef318f43
    
    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

Version: 6.5.0.0.alpha0+
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
Verified

Arch Linux 64-bit
Version: 7.1.0.0.alpha1+
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