diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-01-18 17:08:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-21 16:32:19 +0100 |
commit | ab8e0f5832fa910f8b1abd36d7cb3929cbac2395 (patch) | |
tree | ffd3ed9ec6971699c8c34d6c43b172235c11c4ec /vcl/source | |
parent | 1ebeb2226069683fc1823b8e439e1bd01ddaea6a (diff) |
Resolves: tdf#122484 replace gtk autocomplete with vcl-alike autoselect
Change-Id: I941e32a973cdd1bc79e3739b24fdf834aa52cb11
Reviewed-on: https://gerrit.libreoffice.org/66628
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 28 |
2 files changed, 4 insertions, 27 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 828468d23a70..fb010d50c55a 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2108,6 +2108,7 @@ public: { SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos); m_xTreeView->Select(pEntry, true); + m_xTreeView->MakeVisible(pEntry); } enable_notify_events(); } @@ -3501,6 +3502,8 @@ IMPL_LINK(SalInstanceEntryTreeView, AutocompleteHdl, Edit&, rEdit, void) } } + m_xTreeView->select(nPos); + if (nPos != -1) { OUString aText = m_xTreeView->get_text(nPos); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 76ed9da95b80..fe406ed94b6f 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -376,34 +376,8 @@ namespace weld m_aChangeHdl.Call(*this); } - void EntryTreeView::EntryModifyHdl(weld::Entry& rBox) + IMPL_LINK_NOARG(EntryTreeView, ModifyHdl, weld::Entry&, void) { - OUString sText(rBox.get_text()); - int nExists = m_xTreeView->find_text(sText); - if (nExists != -1) - { - m_xTreeView->select(nExists); - return; - } - - m_xTreeView->select(-1); - if (sText.isEmpty()) - return; - - int nCount = m_xTreeView->n_children(); - for (int i = 0; i < nCount; ++i) - { - if (m_xTreeView->get_text(i).startsWith(sText)) - { - m_xTreeView->select(i); - break; - } - } - } - - IMPL_LINK(EntryTreeView, ModifyHdl, weld::Entry&, rBox, void) - { - EntryModifyHdl(rBox); m_aChangeHdl.Call(*this); } |