loplugin:mergeclasses merge SvxListBoxControl with SvxUndoRedoControl
Change-Id: I5ba9c9d970246d80bb60e27e3b703ec03376c35c
This commit is contained in:
@@ -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
|
||||
|
@@ -29,39 +29,24 @@ 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 );
|
||||
|
||||
DECL_LINK( PopupModeEndHdl, FloatingWindow*, void );
|
||||
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;
|
||||
|
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user