Description: I'm using the listener with the model com.sun.star.awt.grid.UnoControlGridModel. My macro is written in BASIC. With version 6.1.0.3 the selectionChanged of com.sun.star.awt.grid.XGridSelectionListener is not invoked when the user selects a row. Pressing up or down arrow keys the row selected changes and the event selectionChanged is invoked. When the user changes the selection using the left mouse click the event is not invoked. With LO version 6.0.6 (stable version) the event is properly invoked. The problem was first seen in version 6.1.0.3. Steps to Reproduce: 1.Create a new dialog and add a com.sun.star.awt.grid.UnoControlGridModel 2.Add a listener com.sun.star.awt.grid.XGridSelectionListener to the grid control 3.Add a routine to treat selectionChanged() event 4. Fill the grid with some rows 5. Run the macro and show the dialog 6. Select rows using mouse. The event is not invoked. 7. Using up or down arrow keys the envent is invoked. Actual Results: Event selectionChanged() is not responding to mouse clicks. Expected Results: The event selectionChanged should be invoked every time a selection has changed, but it doesn't. Reproducible: Always User Profile Reset: Yes Additional Info: When the user changes the selection with a mouse click, the event selectionChanged should be called.
Different scripting language but looks like a duplicate of https://bugs.documentfoundation.org/show_bug.cgi?id=117849 "XGridSelectionListener is not working in python"
@Silvio I am going to mark this as a duplicate, change the other issue to new and change the summary to reflect it is an API problem not a script language issue. Any chance you could put up an example with your basic routine included and attach it to the other issue? *** This bug has been marked as a duplicate of bug 117849 ***
@Silvio sorry for the confusion I re-read the other issue and this one and I think I was wrong about seeing them as duplicates. Reverting that. Again, if you have an example it would make it faster to confirm.
Created attachment 144376 [details] Test file with macro example code.
Drew, please see the attachment. The LO Calc file has a macro called ShowDialog(). The macro displays a dialog with a grid control with five rows. When the selection is changed you'll see a message box. Here, the event never happens using left mouse button. But, when I use the keyboard up or down arrow keys, the message box is displayed. Thank you!
Confirmed the anomaly is present in 6.1.0.3 and 6.2Alpha, running under Ubuntu 18.04. It is not present in 6.0.5 (also Ubuntu) Will start with a bibisect against the 6.1 repo.
results from bibsect in 6.1 Repo show that anomaly arrived with commit: 0fb4ae8767fa5ff791cd42934b4215011a269eb0 "Modernize a bit svtools" by using for-range loops + use empty() instead of comparing begin and end iterator Effects 23 source files. (includes dialog controller and control controllers) Author: Julien Nabet (adding to CC)
Argh, I'll take a look but it's not gonna be easy considering the size of the patch. Anyway thank you Drew for the bibisect and for having put me in cc.
I confirm reverting 0fb4ae8767fa5ff791cd42934b4215011a269eb0 (+quick and dirty fix conflicts) fixes the pb. Now I can begin the tedious part to find the bug.
I submitted https://gerrit.libreoffice.org/#/c/59526/ on gerrit. The msgbox appears when clicking with this. But I noticed that clicking on "OK" button didn't work. So I think there's probably another bug here.
(In reply to Julien Nabet from comment #10) > ... > But I noticed that clicking on "OK" button didn't work. > So I think there's probably another bug here. It seems related to gtk3 rendering. With gen or gtk rendering, clicking OK works.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=36123b42c5d3084f94d068874a0bac2cc849a66e tdf#119427: fix selectionChanged event It will be available in 6.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Commit Notification from comment #12) > Julien Nabet committed a patch related to this issue. > It has been pushed to "master": > > http://cgit.freedesktop.org/libreoffice/core/commit/ > ?id=36123b42c5d3084f94d068874a0bac2cc849a66e > > tdf#119427: fix selectionChanged event > > It will be available in 6.2.0. > > The patch should be included in the daily builds available at > http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More > information about daily builds can be found at: > http://wiki.documentfoundation.org/Testing_Daily_Builds > > Affected users are encouraged to test the fix and report feedback. That was fast. Thanks. Will check it out (with gen and GTK) using daily build tomorrow.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-6-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=29e5a7cc352e54570d512007421a550cab42d361&h=libreoffice-6-1 tdf#119427: fix selectionChanged event It will be available in 6.1.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thank you Silvio for having filling a bug about this and Drew for bibisection and ping, it allows me to fix a nasty regression due to me.
Thank you Julien and Drew. You were very quick to confirm the bug and resolve it. As soon as I test a new version I will post the results here. Many thanks.
I did a test with LO version Version: 6.1.1.0.0+ Build ID: 29e5a7cc352e54570d512007421a550cab42d361 and the selectionChanged() event was invoked with mouse clicks and keyboard. I confirm that the problem has been resolved. Thank you.