Bug 97066 - listbox "select all: with CTRL+A does not update SelectedItems, SelectedValues, etc properties
Summary: listbox "select all: with CTRL+A does not update SelectedItems, SelectedValue...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.0.3.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.2.0
Keywords: needUITest
: 103974 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-01-12 10:59 UTC by Lionel Elie Mamane
Modified: 2021-05-23 19:45 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
listbox form with multivalue selection enabled (8.60 KB, application/vnd.oasis.opendocument.text)
2016-01-12 17:41 UTC, Alex Thurgood
Details
test case (11.14 KB, application/vnd.oasis.opendocument.text)
2016-01-12 18:52 UTC, Lionel Elie Mamane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2016-01-12 10:59:42 UTC
Consider a listbox with MultiSelection enabled.

Click on one line. It is selected (background put in blue).

Press CTRL+A. All lines are displayed as selected (background in blue), but the SelectedValues and SelectedItems properties still contain only the previously selected lines.

If one clicks on the first line, then SHIFT+click on the last line, the properties are correct.

Teproduced on MS Windows 32 bit and Debian GNU/Linux amd64 (Debian package).
Comment 1 FutureProject 2016-01-12 12:03:27 UTC
Hello, and thank you for reporting this issue.

Can you give a concrete example of which listbox item displays this issue?
Comment 2 Lionel Elie Mamane 2016-01-12 12:13:30 UTC
(In reply to futureproject from comment #1)

> Can you give a concrete example of which listbox item displays this issue?

In a database form (not linked to a field).
Comment 3 Lionel Elie Mamane 2016-01-12 12:18:45 UTC
For complete clarity, I haven't tested it with a listbox linked to a field yet; it may have the same behaviour.
Comment 4 Alex Thurgood 2016-01-12 17:40:33 UTC
Confirming on

Version: 5.2.0.0.alpha0+
Build ID: c93a43c0c9113bc1c787fe6b3c5e58a8bfd80be0
CPU Threads: 2; OS Version: -; UI Render: default; 
Locale : fr-FR (fr.UTF-8)

OSX 10.11.2

Enclosing test file
Comment 5 Alex Thurgood 2016-01-12 17:41:38 UTC
Created attachment 121882 [details]
listbox form with multivalue selection enabled
Comment 6 Alex Thurgood 2016-01-12 17:55:34 UTC
Actually, I might have misunderstood this in my attempt to reproduce.

Lionel, where can you see the properties of your multi-selected values ?
I created a Writer document with a single listbox control, containing values entered as a list in the General tab of the control's properties. Whe I save this form and leave form design mode, if I select one or mutliple non-contiguous or contiguous values from the list they all get selected correctly, and simuilarly if I use Ctrl-A to select all of the values.

It doesn't seem to make any difference whether I use a dropdown list or just a standard frame showing the complete list of possible values.

Resetting back to unconfirmed for the moment, because I get the uncomfortable feeling that I might have misunderstood something somewhere and have not reproduce the buggy behaviour.
Comment 7 Alex Thurgood 2016-01-12 17:58:35 UTC
Is this a DUP of bug 72932 ?
Comment 8 Lionel Elie Mamane 2016-01-12 18:52:42 UTC
Created attachment 121885 [details]
test case

It is easier to see/test with dropdown=false, so I did that.

I added a button "show lstBox selected". Select rows with mouse, click on button.
Select rows with CTRL-A, click button. You'll see the issue. You need to enable macros.
Comment 9 Alex Thurgood 2016-01-14 09:14:42 UTC
(In reply to Lionel Elie Mamane from comment #8)
> Created attachment 121885 [details]
> test case
> 
> It is easier to see/test with dropdown=false, so I did that.
> 
> I added a button "show lstBox selected". Select rows with mouse, click on
> button.
> Select rows with CTRL-A, click button. You'll see the issue. You need to
> enable macros.

Ah thanks. My testing on master dbgutil
Version: 5.2.0.0.alpha0+
Build ID: 569bbec54030ab4e7f45aa9e832cac3aa36430a3
CPU Threads: 2; OS Version: -; UI Render: default; 
Locale : fr-FR (fr.UTF-8)

OSX 10.11.2

When the form opened, I selected four different values, using the Cmd-left mouse button click combination to do so. The values I selected were One, Three, Five and Six.

When I clicked the macro button, I see several messages in sequence (after pressing OK each time) :

First message : "There are 4 items selected"
Second message : SelectedItems(0) is '0'
Third message : SelectedItems(1) is '2'
Fourth message : SelectedItems(2) is '4'
Fifth message : SelectedItems(3) is '5'
Sixth message :There are 4 values selected

So, all of this appears to be correct, as the count for the array starts from value index 0.

The subsequent messages retrieve the value of the corresponding array index, and return the values I had selected in the GUI. So far so good.

Now, I went back to the listbox and selected the first entry, then pressed Cmd-A (select all), and then pressed the macro button :

First message : there are 1 items selected
Second message : SelectedItems(0) is '0'
Third message : SelectedValues(0) is 'One'


No other values are shown.

Confirming.
Comment 10 QA Administrators 2017-03-06 14:20:30 UTC Comment hidden (obsolete)
Comment 11 Balint Fodor 2018-05-29 12:31:48 UTC
It is still present in Version: 6.0.4.2 (x64) Windows 10.
Comment 12 QA Administrators 2019-05-30 02:55:10 UTC Comment hidden (obsolete)
Comment 13 Commit Notification 2021-05-09 20:46:43 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1675a68526c43c6c6e4dc850ee911f0c1de75c88

tdf#97066 - When using CTRL-A in a listbox, update selected items

It will be available in 7.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 14 Andreas Heinisch 2021-05-09 21:01:15 UTC
@x1sco maybe you could provide the uitest?
Comment 15 Lionel Elie Mamane 2021-05-10 16:31:12 UTC
*** Bug 103974 has been marked as a duplicate of this bug. ***