diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-03-12 09:35:30 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-03-12 11:37:01 +0100 |
commit | 2225d8530b4a7fa29e551f9354d679da78be6435 (patch) | |
tree | f585a9edbb425a062659f137acb5d340643a0495 | |
parent | 295c8262f7e7e0436301deed5edde9963b19dd11 (diff) |
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@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | vcl/jsdialog/executor.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index bca3d0a98ea7..aa71178a6605 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -242,7 +242,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()); |