Bug 158561 - Object fit to cell does not fit target cell if source cell was resized before copying
Summary: Object fit to cell does not fit target cell if source cell was resized before...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Anchor-and-Text-Wrap Object
  Show dependency treegraph
 
Reported: 2023-12-06 10:26 UTC by Stéphane Guillou (stragu)
Modified: 2024-03-03 10:45 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
sample ODS (14.68 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-12-06 10:26 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-12-06 10:26:36 UTC
Created attachment 191262 [details]
sample ODS

If an object is anchored "to cell (resize with cell)" and then "fit to cell size", then copied and pasted after a cell resize, the size of the target cell is not respected.

Steps:
1. Open sample document (or fill a cell with an object as described above)
2. Resize the column: object resizes with it, which is good.
3. Copy cell with object (cell A1 or A5 in sample doc)
4. Paste it to other cell

Result: the object does not fit the target cell size.

Bibisected with linux-64-7.6 repository to first bad build commit [e488e9509e327eaf3001ad12d76fd64698593f25] which points to:

commit dfb0d118f6b23730bc632885eb4703a37eeaec16
author	Regina Henschel 	Sat Apr 08 18:38:04 2023 +0200
committer	Regina Henschel 	Sun May 07 10:57:04 2023 +0200
tdf#139083 Only resize if 'resize with cell' is set
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150161

Regina, can you please have a look?
Comment 1 Regina Henschel 2023-12-08 09:09:04 UTC
My first try in https://gerrit.libreoffice.org/c/core/+/160415 doesn't work. The attempt shows, that the anchor info in the shape is not suitable for copy&paste. But changing it in recalcPos() method has the effect, that wrong values are written to file and the shape will be changed after save and reload in some cases. That happens in the broken unit test.

Likely it has to be fixed, when copying the shape to clipboard. Unfortunately I have currently no time for further investigation. Does there exist something like 'remind me in one month'?
Comment 2 Stéphane Guillou (stragu) 2023-12-08 09:37:41 UTC
(In reply to Regina Henschel from comment #1)
> My first try in https://gerrit.libreoffice.org/c/core/+/160415 doesn't work.
> The attempt shows, that the anchor info in the shape is not suitable for
> copy&paste. But changing it in recalcPos() method has the effect, that wrong
> values are written to file and the shape will be changed after save and
> reload in some cases. That happens in the broken unit test.
> 
> Likely it has to be fixed, when copying the shape to clipboard.
> Unfortunately I have currently no time for further investigation. Does there
> exist something like 'remind me in one month'?
Thanks for having a look, Regina!
There's the "Personal Tags" field in the bug report that might be useful to create your personal bug lists (no notification is sent to anyone when changing this field).