Bug 157211

Summary: EDITING: cell range selection modified when opening Calc's "Define Database Range" dialog
Product: LibreOffice Reporter: LucianoB <lburli7>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: stephane.guillou
Priority: high Keywords: bibisected, bisected, regression
Version: 7.4.0.0 alpha1+   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=154044
https://bugs.documentfoundation.org/show_bug.cgi?id=158918
Whiteboard:
Crash report or crash signature: Regression By: Luboš Luňák
Bug Depends on:    
Bug Blocks: 115775, 158550    
Attachments: D9 selected, A9 appears

Description LucianoB 2023-09-12 17:32:34 UTC
Created attachment 189526 [details]
D9 selected, A9 appears

When you define a new area database, the previously selected area changes, you have to edit the address in the dialog window.

In the example: I've selected cell D9, but cell A9 appears in the dialog window.
NB: D9 selected, with light blue background, not simply clicked

There is no rule to guess which area will be selected. Sometimes the area I select is what I see in the dialog window.
Comment 1 Stéphane Guillou (stragu) 2023-09-27 16:09:39 UTC
Thank you for the report!

This behaviour started in 7.4. I tested with the cursor on D9, then open Data > Define Range...
Result: selection for range moves to A9.

Bibisected with linux-64-7.4 repo to first bad commit d14c498f036bf5f6f99503115eeec2a72bd1ba83 which points to core commit:

commit 9e2d48b9e04f7ea895fb095699c32ed8a44eb129
author	Luboš Luňák	Wed Mar 30 11:58:04 2022 +0200
committer	Luboš Luňák	Thu Apr 28 05:51:53 2022 +0200
reduce Calc's INITIALCOLCOUNT to 1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133311

Before that commit, a one-cell selection would be created to populate the field.

Bumping the priority as Luboš is not active anymore.

Still repro in recent master build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 19e9fe7c8c89399753ac1730e1c76378b18418bc
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 2 Stéphane Guillou (stragu) 2024-01-12 16:24:07 UTC
Similarly to bug 158918, if there is data in some columns, the range picker will move to the right-most column with data.
Both issues might be fixed together.