diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2014-08-05 15:39:20 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-09-17 10:19:52 +0200 |
commit | 67bde2460bab738701765f345863c969aa77a8ae (patch) | |
tree | f7f37025149f463d8d4045f33a6d19ea4cfe9449 /svx | |
parent | cb02490a1e35886bc2dc4a9889fdd6db742e5899 (diff) |
Remove redundant class SvxLineColorToolBoxControl
Change-Id: I882ee959baae429307218d3076a2a198ff960ddd
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 69 |
1 files changed, 6 insertions, 63 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 64e00e7d8bd2..cdd6e97bf4e5 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -108,8 +108,6 @@ using namespace ::com::sun::star::lang; SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem ); -SFX_IMPL_TOOLBOX_CONTROL( SvxColorToolBoxControl, SvxColorItem ); -SFX_IMPL_TOOLBOX_CONTROL( SvxLineColorToolBoxControl, XLineColorItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFrameToolBoxControl, SvxBoxItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem ); @@ -2329,73 +2327,18 @@ void SvxColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/) Dispatch( aCommand, aArgs ); } -// class SvxLineColorToolBoxControl ---------------------------------------- - -SvxLineColorToolBoxControl::SvxLineColorToolBoxControl( - sal_uInt16 nSlotId, - sal_uInt16 nId, - ToolBox& rTbx ) : - - SfxToolBoxControl( nSlotId, nId, rTbx ) -{ - rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) ); - addStatusListener( OUString( ".uno:XLineColor" ) ); - pBtnUpdater.reset( new ::svx::ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox() ) ); - mPaletteManager.SetLastColor( COL_BLACK ); - mPaletteManager.SetBtnUpdater( pBtnUpdater.get() ); -} - -SvxLineColorToolBoxControl::~SvxLineColorToolBoxControl() -{ -} - -SfxPopupWindowType SvxLineColorToolBoxControl::GetPopupWindowType() const -{ - return SFX_POPUPWINDOW_ONTIMEOUT; -} - -SfxPopupWindow* SvxLineColorToolBoxControl::CreatePopupWindow() -{ - SvxColorWindow_Impl* pColorWin = - new SvxColorWindow_Impl( - m_aCommandURL, - mPaletteManager, - GetSlotId(), - m_xFrame, - SVX_RESSTR( RID_SVXSTR_LINECOLOR ), - &GetToolBox() ); - - pColorWin->StartPopupMode( &GetToolBox(), - FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF|FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); - pColorWin->StartSelection(); - SetPopupWindow( pColorWin ); - pColorWin->SetSelectedHdl( LINK( this, SvxLineColorToolBoxControl, SelectedHdl ) ); - return pColorWin; -} - -IMPL_LINK(SvxLineColorToolBoxControl, SelectedHdl, Color*, pColor) +SfxToolBoxControl* SvxColorToolBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) { - pBtnUpdater->Update( *pColor ); - mPaletteManager.SetLastColor( *pColor ); - return 0; + return new SvxColorToolBoxControl( nSlotId, nId, rTbx ); } -void SvxLineColorToolBoxControl::StateChanged( - sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* /*pState*/ ) +void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) { - ToolBox& rTbx = GetToolBox(); - sal_uInt16 nId = GetId(); - rTbx.EnableItem( nId, SfxItemState::DISABLED != eState ); - rTbx.SetItemState( nId, ( SfxItemState::DONTCARE == eState ) ? TRISTATE_INDET : TRISTATE_FALSE ); + SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(SvxColorItem), nSlotId ) ); + SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XLineColorItem), nSlotId ) ); } -void SvxLineColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/) -{ - Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = "XLineColor"; - aArgs[0].Value = makeAny( (sal_uInt32)( mPaletteManager.GetLastColor().GetColor() )); - Dispatch( OUString( ".uno:XLineColor" ), aArgs ); -} +// class SvxFrameToolBoxControl -------------------------------------------- SvxFrameToolBoxControl::SvxFrameToolBoxControl( sal_uInt16 nSlotId, |