diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-04-18 10:28:36 +0000 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-04-19 06:31:48 +0000 |
commit | 5d3d8467b3d451742e65f86626ffb275f866327a (patch) | |
tree | 04103d66c4ab9abe20f79a8966ba141d0ede28d2 /sw/source | |
parent | 4740a1a553b1d69b1e381e3961085744244af26f (diff) |
cppcheck: silence known conditions warnings in sw annotsh
Change-Id: I0e5d0eea0c3d8cd14938f45353ca4f27cf09d176
Reviewed-on: https://gerrit.libreoffice.org/24212
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/shells/annotsh.cxx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 0470216eaca5..f6112005c3e0 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -720,16 +720,13 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case FN_SET_SUPER_SCRIPT: case FN_SET_SUB_SCRIPT: { - sal_uInt16 nEsc = 0; - const SfxPoolItem *pEscItem = nullptr; + sal_uInt16 nEsc; if (nWhich==FN_SET_SUPER_SCRIPT) nEsc = SVX_ESCAPEMENT_SUPERSCRIPT; else nEsc = SVX_ESCAPEMENT_SUBSCRIPT; - if( !pEscItem ) - pEscItem = &aEditAttr.Get( EE_CHAR_ESCAPEMENT ); - + const SfxPoolItem *pEscItem = &aEditAttr.Get( EE_CHAR_ESCAPEMENT ); if( nEsc == static_cast<const SvxEscapementItem*>(pEscItem)->GetEnumValue() ) rSet.Put( SfxBoolItem( nWhich, true )); else @@ -741,9 +738,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case SID_ATTR_PARA_ADJUST_CENTER: case SID_ATTR_PARA_ADJUST_BLOCK: { - const SfxPoolItem *pAdjust = nullptr; int eAdjust = 0; - if (nWhich==SID_ATTR_PARA_ADJUST_LEFT) eAdjust = SVX_ADJUST_LEFT; else if (nWhich==SID_ATTR_PARA_ADJUST_RIGHT) @@ -753,8 +748,8 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) else if (nWhich==SID_ATTR_PARA_ADJUST_BLOCK) eAdjust = SVX_ADJUST_BLOCK; - if( !pAdjust ) - aEditAttr.GetItemState( EE_PARA_JUST, false, &pAdjust); + const SfxPoolItem *pAdjust = nullptr; + aEditAttr.GetItemState( EE_PARA_JUST, false, &pAdjust); if( !pAdjust || IsInvalidItem( pAdjust )) { @@ -774,9 +769,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case SID_ATTR_PARA_LINESPACE_15: case SID_ATTR_PARA_LINESPACE_20: { - const SfxPoolItem *pLSpace = nullptr; int nLSpace = 0; - if (nWhich==SID_ATTR_PARA_LINESPACE_10) nLSpace = 100; else if (nWhich==SID_ATTR_PARA_LINESPACE_15) @@ -784,8 +777,8 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) else if (nWhich==SID_ATTR_PARA_LINESPACE_20) nLSpace = 200; - if( !pLSpace ) - aEditAttr.GetItemState( EE_PARA_SBL, false, &pLSpace ); + const SfxPoolItem *pLSpace = nullptr; + aEditAttr.GetItemState( EE_PARA_SBL, false, &pLSpace ); if( !pLSpace || IsInvalidItem( pLSpace )) { |