diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-25 11:34:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-25 11:35:02 +0100 |
commit | c7b6f0733127863ace4f351629301990f99a2178 (patch) | |
tree | d4061f375efefb80e24d2b397908857d6833e856 /sfx2 | |
parent | 5001357be9f0680ad6fbfe1af8c2a7c10b7508ab (diff) |
coverity#1240261 Logically dead code
we must check the new proposed state for sanity, not the
old state
Change-Id: Iabab0ccda4942ec82b243ad07762187be916d43f
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index a6c3be44cd3c..d0486dbbda6c 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -549,9 +549,9 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception ) rEvent.State >>= aItemStatus; SfxItemState tmpState = (SfxItemState) aItemStatus.State; // make sure no-one tries to send us a combination of states - if (eState != SfxItemState::UNKNOWN && eState != SfxItemState::DISABLED && - eState != SfxItemState::READONLY && eState != SfxItemState::DONTCARE && - eState != SfxItemState::DEFAULT && eState != SfxItemState::SET) + if (tmpState != SfxItemState::UNKNOWN && tmpState != SfxItemState::DISABLED && + tmpState != SfxItemState::READONLY && tmpState != SfxItemState::DONTCARE && + tmpState != SfxItemState::DEFAULT && tmpState != SfxItemState::SET) throw ::com::sun::star::uno::RuntimeException("unknown status"); eState = tmpState; pItem = new SfxVoidItem( nSlotId ); @@ -1103,9 +1103,9 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception ) rEvent.State >>= aItemStatus; SfxItemState tmpState = (SfxItemState) aItemStatus.State; // make sure no-one tries to send us a combination of states - if (eState != SfxItemState::UNKNOWN && eState != SfxItemState::DISABLED && - eState != SfxItemState::READONLY && eState != SfxItemState::DONTCARE && - eState != SfxItemState::DEFAULT && eState != SfxItemState::SET) + if (tmpState != SfxItemState::UNKNOWN && tmpState != SfxItemState::DISABLED && + tmpState != SfxItemState::READONLY && tmpState != SfxItemState::DONTCARE && + tmpState != SfxItemState::DEFAULT && tmpState != SfxItemState::SET) throw ::com::sun::star::uno::RuntimeException("unknown status"); eState = tmpState; pItem = new SfxVoidItem( nSlotId ); |