Kaydet (Commit) 52252bb5 authored tarafından Ivan Timofeev's avatar Ivan Timofeev

findbar: use new SetPlaceholderText method

Change-Id: I2e9b825110ed2e83c053b2084c4e6c868d1e9d9f
üst 37c4a408
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment