[Libreoffice-commits] core.git: svx/source
Samuel Mehrbrodt
s.mehrbrodt at gmail.com
Tue Sep 23 12:09:20 PDT 2014
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit ed01da53ff04b1cfd6708e12f26d06cb9288a61f
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date: Tue Sep 23 21:05:38 2014 +0200
fdo#84256 Prepopulate findbar with last search term
Change-Id: I6a6fa994e3e90ade206ffea73b8047ac8b2af90e
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index c23a2cb..d595b3c 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -179,9 +179,15 @@ void FindTextFieldControl::SetTextToSelected_Impl()
if ( !aString.isEmpty() )
{
+ // If something is selected in the document, prepopulate with this
SetText( aString );
GetModifyHdl().Call(this); // FIXME why SetText doesn't trigger this?
}
+ else if (GetEntryCount() > 0)
+ {
+ // Else, prepopulate with last search word (fdo#84256)
+ SetText(GetEntry(0));
+ }
}
bool FindTextFieldControl::PreNotify( NotifyEvent& rNEvt )
@@ -222,7 +228,7 @@ bool FindTextFieldControl::PreNotify( NotifyEvent& rNEvt )
if ( bMod1 && nCode == KEY_F )
SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
- // Execute the search when Enter, Ctrl-G or F3 pressed
+ // Execute the search when Return, Ctrl-G or F3 pressed
if ( KEY_RETURN == nCode || (bMod1 && (KEY_G == nCode)) || (KEY_F3 == nCode) )
{
Remember_Impl(GetText());
More information about the Libreoffice-commits
mailing list