summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-21 15:36:42 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-21 15:52:24 +0000
commit899da0c87348cc298fe8ab43c905eaaab977f781 (patch)
tree4b06a1b37ca9d7925cd220ec8630c0c473ab3343 /sw
parent511d8bbbec6bc95d92a3ac6bbac4c68622738706 (diff)
coverity#705956 Dereference before null check
Change-Id: I2058c5ab31763b0df483737e79ead6c980b966c7
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/uibase/shells/annotsh.cxx23
1 files changed, 9 insertions, 14 deletions
diff --git a/sw/source/core/uibase/shells/annotsh.cxx b/sw/source/core/uibase/shells/annotsh.cxx
index f2602b76d87b..beddafa6ec2e 100644
--- a/sw/source/core/uibase/shells/annotsh.cxx
+++ b/sw/source/core/uibase/shells/annotsh.cxx
@@ -665,20 +665,15 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
case SID_ATTR_CHAR_WEIGHT:
case SID_ATTR_CHAR_POSTURE:
{
- if ( pOLV )
- {
- sal_uInt16 nScriptType = pOLV->GetSelectedScriptType();
- SfxItemPool* pSecondPool = aEditAttr.GetPool()->GetSecondaryPool();
- if( !pSecondPool )
- pSecondPool = aEditAttr.GetPool();
- SvxScriptSetItem aSetItem( nSlotId, *pSecondPool );
- aSetItem.GetItemSet().Put( aEditAttr, false );
- const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
- if( pI )
- rSet.Put( *pI, nWhich );
- else
- rSet.InvalidateItem( nWhich );
- }
+ sal_uInt16 nScriptType = pOLV->GetSelectedScriptType();
+ SfxItemPool* pSecondPool = aEditAttr.GetPool()->GetSecondaryPool();
+ if( !pSecondPool )
+ pSecondPool = aEditAttr.GetPool();
+ SvxScriptSetItem aSetItem( nSlotId, *pSecondPool );
+ aSetItem.GetItemSet().Put( aEditAttr, false );
+ const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
+ if( pI )
+ rSet.Put( *pI, nWhich );
else
rSet.InvalidateItem( nWhich );
}