summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-11-26 23:28:57 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-11-27 00:15:15 +0400
commit52252bb529a41979aa4f11d529ae555401ae8563 (patch)
tree8b0b4337af2a5d2d5fa18dcba7867cf006799612 /svx
parent37c4a408ebd2895ca06e6a22c54591494e9ec52c (diff)
findbar: use new SetPlaceholderText method
Change-Id: I2e9b825110ed2e83c053b2084c4e6c868d1e9d9f
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/tbunosearchcontrollers.hxx4
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx36
2 files changed, 3 insertions, 37 deletions
diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx
index 8fb7d33b2583..88291a81dfd0 100644
--- a/svx/inc/tbunosearchcontrollers.hxx
+++ b/svx/inc/tbunosearchcontrollers.hxx
@@ -60,10 +60,8 @@ public:
css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
virtual ~FindTextFieldControl();
- virtual void Modify();
virtual long PreNotify( NotifyEvent& rNEvt );
- void InitControls_Impl();
void Remember_Impl(const String& rStr);
void SetTextToSelected_Impl();
@@ -71,8 +69,6 @@ private:
css::uno::Reference< css::frame::XFrame > m_xFrame;
css::uno::Reference< css::lang::XMultiServiceFactory > m_xServiceManager;
- sal_Bool m_bToClearTextField;
-
};
class SearchToolbarControllersManager
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index acbb95e26b30..3ea241ddf0ba 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -81,24 +81,16 @@ FindTextFieldControl::FindTextFieldControl( Window* pParent, WinBits nStyle,
css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager) :
ComboBox( pParent, nStyle ),
m_xFrame(xFrame),
- m_xServiceManager(xServiceManager),
- m_bToClearTextField(sal_True)
+ m_xServiceManager(xServiceManager)
{
- InitControls_Impl();
+ SetPlaceholderText(SVX_RESSTR(RID_SVXSTR_FINDBAR_FIND));
+ EnableAutocomplete(sal_True, sal_True);
}
FindTextFieldControl::~FindTextFieldControl()
{
}
-void FindTextFieldControl::InitControls_Impl()
-{
- SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) );
- SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor());
-
- EnableAutocomplete(sal_True, sal_True);
-}
-
void FindTextFieldControl::Remember_Impl(const String& rStr)
{
sal_uInt16 nCount = GetEntryCount();
@@ -137,17 +129,9 @@ void FindTextFieldControl::SetTextToSelected_Impl()
if ( aString.getLength() != 0 )
{
SetText( aString );
- m_bToClearTextField = sal_False;
}
}
-void FindTextFieldControl::Modify()
-{
- ComboBox::Modify();
-
- SetControlForeground( GetSettings().GetStyleSettings().GetWindowTextColor() );
-}
-
long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt )
{
long nRet= ComboBox::PreNotify( rNEvt );
@@ -208,22 +192,8 @@ long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt )
}
case EVENT_GETFOCUS:
- if ( m_bToClearTextField )
- {
- SetText( OUString() );
- m_bToClearTextField = sal_False;
- }
SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
break;
-
- case EVENT_LOSEFOCUS:
- if ( GetText().Len() == 0 )
- {
- SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) );
- SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor());
- m_bToClearTextField = sal_True;
- }
- break;
}
return nRet;