summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx47
1 files changed, 16 insertions, 31 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 5118449c165d..725c50c004f7 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2547,41 +2547,26 @@ void SvxColorExtToolBoxControl::StateChanged(
sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
{
- const SvxColorItem* pItem = 0;
- if ( bChoiceFromPalette && nSID == GetSlotId() )
+ if (nSID == GetSlotId())
{
- bChoiceFromPalette = sal_False;
- switch( nSID )
- {
- case SID_ATTR_CHAR_COLOR :
- case SID_ATTR_CHAR_COLOR2 :
- case SID_ATTR_CHAR_COLOR_BACKGROUND :
- case SID_BACKGROUND_COLOR :
- if ( SFX_ITEM_DONTCARE != eState )
- pItem = PTR_CAST( SvxColorItem, pState );
+ ToolBox& rTbx = GetToolBox();
+ sal_uInt16 nId = GetId();
+ rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
+ rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
- if ( pItem )
- {
- pBtnUpdater->Update( pItem->GetValue() );
- mLastColor = pItem->GetValue();
- }
- break;
+ if (bChoiceFromPalette)
+ {
+ bChoiceFromPalette = sal_False;
- case SID_FRAME_LINECOLOR :
- ToolBox& rTbx = GetToolBox();
- rTbx.EnableItem( nSID, SFX_ITEM_DISABLED != eState );
- rTbx.SetItemState( nSID, ( SFX_ITEM_DONTCARE == eState ) ? STATE_DONTKNOW : STATE_NOCHECK );
+ const SvxColorItem* pItem = 0;
+ if ( SFX_ITEM_DONTCARE != eState )
+ pItem = PTR_CAST( SvxColorItem, pState );
- if ( SFX_ITEM_DONTCARE != eState )
- {
- pItem = PTR_CAST( SvxColorItem, pState );
- if ( pItem )
- {
- pBtnUpdater->Update( pItem->GetValue());
- mLastColor = pItem->GetValue();
- }
- }
- break;
+ if ( pItem )
+ {
+ pBtnUpdater->Update( pItem->GetValue() );
+ mLastColor = pItem->GetValue();
+ }
}
}
}