From 0927bdaf6e9aa58fc443f1c011aa1cc53c8d7cad Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 13 Oct 2016 16:06:54 +0200 Subject: loplugin:mergeclasses merge SvxListBoxControl with SvxUndoRedoControl Change-Id: I5ba9c9d970246d80bb60e27e3b703ec03376c35c --- svx/source/tbxctrls/lboxctrl.cxx | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) (limited to 'svx/source/tbxctrls/lboxctrl.cxx') 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 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 { -- cgit