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: 2026-03-04 03:13 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).
Comment 3 QA Administrators 2026-03-04 03:13:34 UTC
Dear Stéphane Guillou (stragu),

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug