[Libreoffice-commits] core.git: vcl/jsdialog
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 6 17:38:03 UTC 2021
vcl/jsdialog/executor.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit a7f1439ca765384b8352a054ea2da28ef68c02ff
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Mon Feb 15 19:43:17 2021 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Apr 6 19:37:22 2021 +0200
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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113677
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro at collabora.com>
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 3644dc1bcf9b..de055a9c1700 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -220,11 +220,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