summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-09-23 21:05:38 +0200
committerSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-09-23 21:07:44 +0200
commited01da53ff04b1cfd6708e12f26d06cb9288a61f (patch)
treefd34591cfd58f6ba622287b87e6ca1dd0044835e /svx
parent7c1686a6e493cec75e77fa6647c33b537e493457 (diff)
fdo#84256 Prepopulate findbar with last search term
Change-Id: I6a6fa994e3e90ade206ffea73b8047ac8b2af90e
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index c23a2cb03706..d595b3c45a52 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());