Bug 157211 - EDITING: cell range selection modified when opening Calc's "Define Database Range" dialog
Summary: EDITING: cell range selection modified when opening Calc's "Define Database R...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha1+
Hardware: All All
: high normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:26.2.0 target:25.8.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Calc-DataRange regressions-InitialColCount-to-1
  Show dependency treegraph
 
Reported: 2023-09-12 17:32 UTC by LucianoB
Modified: 2025-11-27 15:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
D9 selected, A9 appears (14.79 KB, image/png)
2023-09-12 17:32 UTC, LucianoB
Details

Note You need to log in before you can comment on or make changes to this bug.
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.
Comment 3 Markus Mohrhard 2025-11-18 04:49:14 UTC
I think I have a fix for this issue. I'll need to run a number of manual tests to make sure it does not introduce any other issues.
Comment 4 Commit Notification 2025-11-20 07:46:54 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/512edf27d5593b2123034c5797b2bee3b27bf307

tdf#157211: don't limit range to data range when opening DB name dialog

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2025-11-27 15:35:41 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/fd1b7b7635fcddabafb3b6c4b27ebe5d5bac9e01

tdf#157211: don't limit range to data range when opening DB name dialog

It will be available in 25.8.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.