diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-06 14:23:31 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-07 08:27:26 +0200 |
commit | 973961ae604a46e4badb5a355d539f5d3573c4eb (patch) | |
tree | 30701e02d5d92171f94214e88af144b8e0639f1b /framework | |
parent | 94b0c2203b4efd46c0da06f4918c610909103bd8 (diff) |
loplugin:mergeclasses
Change-Id: I01810a8db024e207783fc09b88bd932bca8ed103
Diffstat (limited to 'framework')
3 files changed, 30 insertions, 46 deletions
diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx b/framework/inc/uielement/comboboxtoolbarcontroller.hxx index 1850c45eb669..df513d4fb51b 100644 --- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx +++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx @@ -33,23 +33,7 @@ namespace framework class ComboBoxControl; -class IComboBoxListener -{ - public: - virtual void Select() = 0; - virtual void DoubleClick() = 0; - virtual void Modify() = 0; - virtual void KeyInput( const KeyEvent& rKEvt ) = 0; - virtual void GetFocus() = 0; - virtual void LoseFocus() = 0; - virtual bool PreNotify( NotifyEvent& rNEvt ) = 0; - - protected: - ~IComboBoxListener() {} -}; - -class ComboboxToolbarController : public IComboBoxListener, - public ComplexToolbarController +class ComboboxToolbarController : public ComplexToolbarController { public: @@ -64,14 +48,14 @@ class ComboboxToolbarController : public IComboBoxListener, // XComponent virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - // IComboBoxListener - virtual void Select() SAL_OVERRIDE; - virtual void DoubleClick() SAL_OVERRIDE; - virtual void Modify() SAL_OVERRIDE; - virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; - virtual void GetFocus() SAL_OVERRIDE; - virtual void LoseFocus() SAL_OVERRIDE; - virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; + // called from ComboBoxControl + void Select(); + void DoubleClick(); + void Modify(); + void KeyInput( const KeyEvent& rKEvt ); + void GetFocus(); + void LoseFocus(); + bool PreNotify( NotifyEvent& rNEvt ); protected: virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) SAL_OVERRIDE; diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx index 9b3703687dc4..956b53b13eff 100644 --- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx +++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx @@ -63,7 +63,7 @@ class DropdownToolbarController : public IListBoxListener, // XComponent virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - // IComboBoxListener + // IListBoxListener virtual void Select() SAL_OVERRIDE; virtual void DoubleClick() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index ec54cd1b8a92..3d62f50bb78c 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -47,13 +47,13 @@ namespace framework { // Wrapper class to notify controller about events from combobox. -// Unfortunaltly the events are notifed through virtual methods instead +// Unfortunately the events are notified through virtual methods instead // of Listeners. class ComboBoxControl : public ComboBox { public: - ComboBoxControl( vcl::Window* pParent, WinBits nStyle, IComboBoxListener* pComboBoxListener ); + ComboBoxControl( vcl::Window* pParent, WinBits nStyle, ComboboxToolbarController* pComboboxToolbarController ); virtual ~ComboBoxControl(); virtual void dispose() SAL_OVERRIDE; @@ -66,12 +66,12 @@ class ComboBoxControl : public ComboBox virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; private: - IComboBoxListener* m_pComboBoxListener; + ComboboxToolbarController* m_pComboboxToolbarController; }; -ComboBoxControl::ComboBoxControl( vcl::Window* pParent, WinBits nStyle, IComboBoxListener* pComboBoxListener ) : +ComboBoxControl::ComboBoxControl( vcl::Window* pParent, WinBits nStyle, ComboboxToolbarController* pComboboxToolbarController ) : ComboBox( pParent, nStyle ) - , m_pComboBoxListener( pComboBoxListener ) + , m_pComboboxToolbarController( pComboboxToolbarController ) { } @@ -82,57 +82,57 @@ ComboBoxControl::~ComboBoxControl() void ComboBoxControl::dispose() { - m_pComboBoxListener = 0; + m_pComboboxToolbarController = 0; ComboBox::dispose(); } void ComboBoxControl::Select() { ComboBox::Select(); - if ( m_pComboBoxListener ) - m_pComboBoxListener->Select(); + if ( m_pComboboxToolbarController ) + m_pComboboxToolbarController->Select(); } void ComboBoxControl::DoubleClick() { ComboBox::DoubleClick(); - if ( m_pComboBoxListener ) - m_pComboBoxListener->DoubleClick(); + if ( m_pComboboxToolbarController ) + m_pComboboxToolbarController->DoubleClick(); } void ComboBoxControl::Modify() { ComboBox::Modify(); - if ( m_pComboBoxListener ) - m_pComboBoxListener->Modify(); + if ( m_pComboboxToolbarController ) + m_pComboboxToolbarController->Modify(); } void ComboBoxControl::KeyInput( const ::KeyEvent& rKEvt ) { ComboBox::KeyInput( rKEvt ); - if ( m_pComboBoxListener ) - m_pComboBoxListener->KeyInput( rKEvt ); + if ( m_pComboboxToolbarController ) + m_pComboboxToolbarController->KeyInput( rKEvt ); } void ComboBoxControl::GetFocus() { ComboBox::GetFocus(); - if ( m_pComboBoxListener ) - m_pComboBoxListener->GetFocus(); + if ( m_pComboboxToolbarController ) + m_pComboboxToolbarController->GetFocus(); } void ComboBoxControl::LoseFocus() { ComboBox::LoseFocus(); - if ( m_pComboBoxListener ) - m_pComboBoxListener->LoseFocus(); + if ( m_pComboboxToolbarController ) + m_pComboboxToolbarController->LoseFocus(); } bool ComboBoxControl::PreNotify( NotifyEvent& rNEvt ) { bool bRet = false; - if ( m_pComboBoxListener ) - bRet = m_pComboBoxListener->PreNotify( rNEvt ); + if ( m_pComboboxToolbarController ) + bRet = m_pComboboxToolbarController->PreNotify( rNEvt ); if ( !bRet ) bRet = ComboBox::PreNotify( rNEvt ); |