[Libreoffice-commits] core.git: vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 7 07:04:39 UTC 2021


 vcl/jsdialog/executor.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit c5153e90784af25890487dd00bcd1f8ac28cc346
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Mar 12 09:35:30 2021 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 7 09:03:59 2021 +0200

    jsdialog: unselect treeview entry by iterator
    
    avoid crash when using relative position from
    deeper levels returned by get_selected_index
    to unselect entry using unselect function
    on root level
    
    Change-Id: Iaaddb131031eb5273cb06412c976f310f7323f52
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112374
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113678
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index de055a9c1700..7462f6aa3095 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -220,7 +220,10 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
                 {
                     OString nRowString
                         = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
-                    pTreeView->unselect(pTreeView->get_selected_index());
+
+                    std::unique_ptr<weld::TreeIter> itSelected(pTreeView->make_iterator());
+                    pTreeView->get_selected(itSelected.get());
+                    pTreeView->unselect(*itSelected);
 
                     int nAbsPos = std::atoi(nRowString.getStr());
 


More information about the Libreoffice-commits mailing list