Bug 158592 - Control anchored and fit to cell jumps to different cell when changing Anchor setting in Control Properties
Summary: Control anchored and fit to cell jumps to different cell when changing Anchor...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Anchor-and-Text-Wrap Form-Controls
  Show dependency treegraph
 
Reported: 2023-12-08 07:58 UTC by Stéphane Guillou (stragu)
Modified: 2023-12-08 23:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sample ODS with text box form control anchored to cell, resized to fit cell (8.72 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-12-08 08:15 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-08 07:58:23 UTC
If the anchoring of a form control that was resized to fit the cell is set "to cell" from the Control Properties dialog, it moves to another cell toward the top left.

Steps:
1. Open Calc (or open attachment and jump to step 6)
2. Insert > Form Control > Text box
3. Trace the control further than column C and row 2 (for example, on cell E10)
4. right-click on the control > Anchor > To cell (or "resize with cell", same thing)
5. right-click on the control > Fit to cell size
6. right-click on the control > Control properties > Anchor > To cell (repeatedly)

Result: the control jumps from cell to cell at each click, until it settles in cell C2. The change can't be undone.
Same happens with other controls, e.g. a Numerical Field.

Note that the setting does not have the option "To cell (resize with cell)", which might be related to the issue?

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Also reproduced with sample file in Ooo 3.3, so issue is inherited (although the option to "Fit to Cell Size" was only added in 6.1 for bug 116108).

Seems to have to do with the position of the top-right corner, possibly because of rounding.

Samuel, I thought you might be interested?
Comment 1 Stéphane Guillou (stragu) 2023-12-08 08:15:01 UTC
Created attachment 191307 [details]
sample ODS with text box form control anchored to cell, resized to fit cell
Comment 2 m_a_riosv 2023-12-08 23:41:29 UTC
Reproducible
Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded