diff options
-rw-r--r-- | chart2/source/controller/dialogs/tp_AxisLabel.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 16 | ||||
-rw-r--r-- | svx/source/tbxctrls/formatpaintbrushctrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 4 |
4 files changed, 20 insertions, 8 deletions
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx index 35676394c983..5163ebb27ead 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -153,7 +153,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs ) bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); m_pCbShowDescription->Check( bCheck ); - if( aState != SFX_ITEM_DEFAULT && aState != SFX_ITEM_SET) + if( aState != SFX_ITEM_DEFAULT && aState != SFX_ITEM_SET ) m_pCbShowDescription->Hide(); } @@ -201,7 +201,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs ) bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); m_pCbTextOverlap->Check( bCheck ); - if( aState != SFX_ITEM_DEFAULT ) + if( aState != SFX_ITEM_DEFAULT && aState != SFX_ITEM_SET ) m_pCbTextOverlap->Hide(); } @@ -220,7 +220,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs ) bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); m_pCbTextBreak->Check( bCheck ); - if( aState != SFX_ITEM_DEFAULT ) + if( aState != SFX_ITEM_DEFAULT && aState != SFX_ITEM_SET ) { m_pCbTextBreak->Hide(); if( ! m_pCbTextOverlap->IsVisible() ) diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 47348ec1e989..22a36a73c2ae 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -547,7 +547,13 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; - eState = (SfxItemState) aItemStatus.State; + SfxItemState tmpState = (SfxItemState) aItemStatus.State; + // make sure no-one tries to send us a combination of states + if (eState != SfxItemState::UNKNOWN && eState != SFX_ITEM_DISABLED && + eState != SFX_ITEM_READONLY && eState != SFX_ITEM_DONTCARE && + eState != SFX_ITEM_DEFAULT && eState != SFX_ITEM_SET) + throw ::com::sun::star::uno::RuntimeException("unknown status"); + eState = tmpState; pItem = new SfxVoidItem( nSlotId ); } else if ( pType == cppu::UnoType< ::com::sun::star::frame::status::Visibility>::get() ) @@ -1095,7 +1101,13 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception ) { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; - eState = (SfxItemState) aItemStatus.State; + SfxItemState tmpState = (SfxItemState) aItemStatus.State; + // make sure no-one tries to send us a combination of states + if (eState != SfxItemState::UNKNOWN && eState != SFX_ITEM_DISABLED && + eState != SFX_ITEM_READONLY && eState != SFX_ITEM_DONTCARE && + eState != SFX_ITEM_DEFAULT && eState != SFX_ITEM_SET) + throw ::com::sun::star::uno::RuntimeException("unknown status"); + eState = tmpState; pItem = new SfxVoidItem( nSlotId ); } else if ( pType == cppu::UnoType< ::com::sun::star::frame::status::Visibility>::get() ) diff --git a/svx/source/tbxctrls/formatpaintbrushctrl.cxx b/svx/source/tbxctrls/formatpaintbrushctrl.cxx index 27c6c8aa8067..7e5619deeffa 100644 --- a/svx/source/tbxctrls/formatpaintbrushctrl.cxx +++ b/svx/source/tbxctrls/formatpaintbrushctrl.cxx @@ -96,7 +96,7 @@ void FormatPaintBrushToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/) void FormatPaintBrushToolBoxControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { - if( eState != SFX_ITEM_SET ) + if( eState != SFX_ITEM_DEFAULT && eState != SFX_ITEM_SET ) m_bPersistentCopy = false; SfxToolBoxControl::StateChanged( nSID, eState, pState ); } diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index f60fc5e445f0..e9aeddb0e5de 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -4024,8 +4024,8 @@ static void lcl_PushNumruleState( SfxItemState &aNumRuleState, SwNumRuleItem &aN } } -static void lcl_PopNumruleState( int aNumRuleState, const SwNumRuleItem &aNumRuleItem, - int aListIdState, const SfxStringItem &aListIdItem, +static void lcl_PopNumruleState( SfxItemState aNumRuleState, const SwNumRuleItem &aNumRuleItem, + SfxItemState aListIdState, const SfxStringItem &aListIdItem, SwTxtNode *pDestTxtNd, const SwPaM& rPam ) { /* If only a part of one paragraph is copied |