diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-13 16:06:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-14 08:17:50 +0200 |
commit | 0927bdaf6e9aa58fc443f1c011aa1cc53c8d7cad (patch) | |
tree | 9e4917d61734e64fa4a36ad8f7a5ccc10c372b20 | |
parent | 6bdfb757338118778b622b401d16606cf96caca6 (diff) |
loplugin:mergeclasses merge SvxListBoxControl with SvxUndoRedoControl
Change-Id: I5ba9c9d970246d80bb60e27e3b703ec03376c35c
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | include/svx/lboxctrl.hxx | 23 | ||||
-rw-r--r-- | svx/source/tbxctrls/lboxctrl.cxx | 39 |
3 files changed, 11 insertions, 52 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index 47a802baa2ac..d630db15a7ad 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -145,7 +145,6 @@ merge SvXMLExportItemMapper with SwXMLTableItemMapper_Impl merge SvXMLImportItemMapper with SwXMLImportTableItemMapper_Impl merge SvXMLItemSetContext with SwXMLItemSetContext_Impl merge SvxCSS1Parser with SwCSS1Parser -merge SvxListBoxControl with SvxUndoRedoControl merge SvxRTFParser with EditRTFParser merge SvxShapeMaster with SdXShape merge SwAccessibleFrame with SwAccessibleContext diff --git a/include/svx/lboxctrl.hxx b/include/svx/lboxctrl.hxx index 44cc61fcf6ad..eaa9a2f215f1 100644 --- a/include/svx/lboxctrl.hxx +++ b/include/svx/lboxctrl.hxx @@ -29,11 +29,12 @@ class ToolBox; class SvxPopupWindowListBox; -class SvxListBoxControl : public SfxToolBoxControl +class SVX_DLLPUBLIC SvxUndoRedoControl : public SfxToolBoxControl { -protected: OUString aActionStr; VclPtr<SvxPopupWindowListBox> pPopupWin; + std::vector< OUString > aUndoRedoList; + OUString aDefaultTooltip; void Impl_SetInfo( sal_Int32 nCount ); @@ -41,27 +42,11 @@ protected: DECL_LINK( SelectHdl, ListBox&, void ); public: - SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SvxListBoxControl() override; - - virtual VclPtr<SfxPopupWindow> CreatePopupWindow() override; - virtual void StateChanged( sal_uInt16 nSID, - SfxItemState eState, - const SfxPoolItem* pState ) override; -}; - - -class SVX_DLLPUBLIC SvxUndoRedoControl : public SvxListBoxControl -{ - std::vector< OUString > aUndoRedoList; - OUString aDefaultTooltip; - -public: SFX_DECL_TOOLBOX_CONTROL(); SvxUndoRedoControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); - virtual ~SvxUndoRedoControl() override; + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override; diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx index 1aab1bfd8fd3..3c1c504cb1b1 100644 --- a/svx/source/tbxctrls/lboxctrl.cxx +++ b/svx/source/tbxctrls/lboxctrl.cxx @@ -121,34 +121,7 @@ void SvxPopupWindowListBox::statusChanged( const css::frame::FeatureStateEvent& SfxPopupWindow::statusChanged( rEvent ); } -SvxListBoxControl::SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) - :SfxToolBoxControl( nSlotId, nId, rTbx ), - pPopupWin ( nullptr ) -{ - rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) ); - rTbx.Invalidate(); -} - - -SvxListBoxControl::~SvxListBoxControl() -{} - -VclPtr<SfxPopupWindow> SvxListBoxControl::CreatePopupWindow() -{ - OSL_FAIL( "not implemented" ); - return nullptr; -} - - -void SvxListBoxControl::StateChanged( - sal_uInt16, SfxItemState, const SfxPoolItem* pState ) -{ - GetToolBox().EnableItem( GetId(), - SfxItemState::DISABLED != GetItemState(pState) ); -} - - -IMPL_LINK_NOARG(SvxListBoxControl, PopupModeEndHdl, FloatingWindow*, void) +IMPL_LINK_NOARG(SvxUndoRedoControl, PopupModeEndHdl, FloatingWindow*, void) { if( pPopupWin && FloatWinPopupFlags::NONE == pPopupWin->GetPopupModeFlags() && pPopupWin->IsUserSelected() ) @@ -165,7 +138,7 @@ IMPL_LINK_NOARG(SvxListBoxControl, PopupModeEndHdl, FloatingWindow*, void) } -void SvxListBoxControl::Impl_SetInfo( sal_Int32 nCount ) +void SvxUndoRedoControl::Impl_SetInfo( sal_Int32 nCount ) { DBG_ASSERT( pPopupWin, "NULL pointer, PopupWindow missing" ); @@ -184,7 +157,7 @@ void SvxListBoxControl::Impl_SetInfo( sal_Int32 nCount ) } -IMPL_LINK_NOARG(SvxListBoxControl, SelectHdl, ListBox&, void) +IMPL_LINK_NOARG(SvxUndoRedoControl, SelectHdl, ListBox&, void) { if (pPopupWin) { @@ -205,7 +178,8 @@ IMPL_LINK_NOARG(SvxListBoxControl, SelectHdl, ListBox&, void) SFX_IMPL_TOOLBOX_CONTROL( SvxUndoRedoControl, SfxStringItem ); SvxUndoRedoControl::SvxUndoRedoControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) - : SvxListBoxControl( nSlotId, nId, rTbx ) + :SfxToolBoxControl( nSlotId, nId, rTbx ), + pPopupWin ( nullptr ) { rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) ); rTbx.Invalidate(); @@ -233,7 +207,8 @@ void SvxUndoRedoControl::StateChanged( const OUString& aQuickHelpText = rItem.GetValue(); rBox.SetQuickHelpText( GetId(), aQuickHelpText ); } - SvxListBoxControl::StateChanged( nSID, eState, pState ); + GetToolBox().EnableItem( GetId(), + SfxItemState::DISABLED != GetItemState(pState) ); } else { |