summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/tbunosearchcontrollers.cxx
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2023-04-26 19:40:34 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2023-04-27 11:12:52 +0200
commit89afe2978500233dc7b58d39cc519ecb9c224e98 (patch)
tree42638d3c56727fe1a442052603a6ab9f931b10d3 /svx/source/tbxctrls/tbunosearchcontrollers.cxx
parente4410284c9907c5c8938a4f54bdde22cf27bba56 (diff)
tdf#154818 - Find bar: remember and reuse last search string
If there exists no last search string in the view options and there exists a search history, preselect the last search item. Change-Id: Ic6056e02eaf6c0ee7e266e47ba961dff11e9f9da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151072 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'svx/source/tbxctrls/tbunosearchcontrollers.cxx')
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index d43222fe4e32..1ae8a0b5c738 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -268,9 +268,12 @@ void FindTextFieldControl::SetTextToSelected_Impl()
{
css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem");
aUserItem >>= aString;
- // prepopulate with last search word (fdo#84256)
- m_xWidget->set_entry_text(aString);
}
+ else if (get_count() > 0)
+ aString = m_xWidget->get_text(0);
+
+ // prepopulate with last search word (fdo#84256)
+ m_xWidget->set_entry_text(aString);
}
}