From d92602c5b13d0a60439d86c5a033d124178726ca Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 10 Sep 2014 14:20:18 +0200 Subject: more fixes for SfxItemState In commit 88a874fc "convert SfxItemState constants to a proper enum" I made some mistakes in converting bitwise logic to boolean logic. I fixed one of those places in commit 7ad83656 "fix bitwise->logic conversion in SfxItemState commit" This commit fixes the other places where I converted bitwise to normal boolean logic. I also validated that none of the existing code tries to uses combinations of these enum values. This commit also introduces an exception-throwing check in the one place where the enum is explicitly cast to make sure that no combinations sneak in. Change-Id: I545f7d17b76c4fd999078867caec314e83ffe165 Signed-off-by: Stephan Bergmann --- svx/source/tbxctrls/formatpaintbrushctrl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svx') 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 ); } -- cgit v1.2.3