From 584b415924bba22db23a4258062e54973de0ed7c Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Sun, 11 May 2014 02:21:23 +0300 Subject: Keep only one class for toolbox color controls instead of 5 (mostly identical) classes. Also the following bugs were fixed: * All pickers now use split buttons. (fdo#45671) * Color palette now indicates the current color. (fdo#73891) (Previous changes related to that bug are reverted as part of this commit.) * Selecting a color from a float panel now updates the button. (fdo#77683) * For Font color/background color in Writer, the color that is shown on the button, is always the one that's actually used. (Can be a different color after hiding the toolbar.) * For Font color/background color in Writer, the button now indicates when we're in the format paintbrush mode. (Removed in 085e8a07e61ef2d3a82e11094d8773ab17cfdb3c for some reason.) Change-Id: Idb4829552240c52fb0882aca627c8177bbe2f839 --- svx/source/tbxctrls/extrusioncontrols.cxx | 70 ------------------------------- 1 file changed, 70 deletions(-) (limited to 'svx/source/tbxctrls/extrusioncontrols.cxx') diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index a4ac4362c87e..42dfaa55c440 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -36,7 +36,6 @@ #include #include #include -#include "svx/extrusioncolorcontrol.hxx" #include "coreservices.hxx" #include "helpid.hrc" @@ -956,75 +955,6 @@ Sequence< OUString > SAL_CALL ExtrusionSurfaceControl::getSupportedServiceNames( return ExtrusionSurfaceControl_getSupportedServiceNames(); } - - -SFX_IMPL_TOOLBOX_CONTROL( ExtrusionColorControl, SvxColorItem ); - -ExtrusionColorControl::ExtrusionColorControl( - sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) -: SfxToolBoxControl ( nSlotId, nId, rTbx ), - mLastColor( COL_AUTO ) -{ - rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) ); - mpBtnUpdater = new ToolboxButtonColorUpdater( nSlotId, nId, &GetToolBox() ); -} - - - -ExtrusionColorControl::~ExtrusionColorControl() -{ - delete mpBtnUpdater; -} - - - -SfxPopupWindowType ExtrusionColorControl::GetPopupWindowType() const -{ - return SFX_POPUPWINDOW_ONCLICK; -} - - - -SfxPopupWindow* ExtrusionColorControl::CreatePopupWindow() -{ - SvxColorWindow_Impl* pColorWin = new SvxColorWindow_Impl( - OUString( ".uno:Extrusion3DColor" ), - SID_EXTRUSION_3D_COLOR, - m_xFrame, - SVX_RESSTR( RID_SVXSTR_EXTRUSION_COLOR ), - &GetToolBox(), - mLastColor ); - pColorWin->StartPopupMode( &GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF ); - pColorWin->StartSelection(); - SetPopupWindow( pColorWin ); - return pColorWin; -} - - - -void ExtrusionColorControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) -{ - sal_uInt16 nId = GetId(); - ToolBox& rTbx = GetToolBox(); - - if( nSID == SID_EXTRUSION_3D_COLOR ) - { - const SvxColorItem* pItem = 0; - - if( SFX_ITEM_DONTCARE != eState ) - pItem = PTR_CAST( SvxColorItem, pState ); - - if ( pItem ) - { - mpBtnUpdater->Update( pItem->GetValue()); - mLastColor = pItem->GetValue(); - } - } - - rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState ); - rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? TRISTATE_INDET : TRISTATE_FALSE ); -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit