[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/jsdialog
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 23 14:22:26 UTC 2021
vcl/jsdialog/executor.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 99937777801d0fc9574d03c40369de166f601d9c
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Mon Feb 15 19:43:17 2021 -0400
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Feb 23 15:21:52 2021 +0100
lok: fix treeview action "select"
Unfortunately the Macros dialog has a treeview control
that fill on demand and the position is absolute and
it has a side effect to deselect the item since the relative
entry position is nullptr.
Change-Id: Ie442f6d634437a293cde65da0764d3f433a70155
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110963
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 4c40109a5057..bca3d0a98ea7 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -242,11 +242,14 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
{
OString nRowString
= OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
- int nRow = std::atoi(nRowString.getStr());
-
pTreeView->unselect(pTreeView->get_selected_index());
- pTreeView->select(nRow);
- pTreeView->set_cursor(nRow);
+
+ int nAbsPos = std::atoi(nRowString.getStr());
+
+ std::unique_ptr<weld::TreeIter> itEntry(pTreeView->make_iterator());
+ pTreeView->get_iter_abs_pos(*itEntry, nAbsPos);
+ pTreeView->select(*itEntry);
+ pTreeView->set_cursor(*itEntry);
LOKTrigger::trigger_changed(*pTreeView);
return true;
}
More information about the Libreoffice-commits
mailing list