summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-10-14 12:20:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-10-14 15:02:43 +0100
commiteac7e540d1caa6526d4e5b00c335e2c4e0839585 (patch)
tree9d583484a79f81d36270c80fa954282f7c92cb19 /sw/source
parent025be45eb126c65db5eed301cd623cffcf726efd (diff)
coverity#7359798 Unchecked dynamic_cast
Change-Id: I6851ec09bb8ed6134fd1cfe3aa830f5557efdc8d
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 105199fb1219..053c034bf6f4 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -263,8 +263,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
{
case RES_LR_SPACE:
{
- SvxLRSpaceItem* pLRSpace = dynamic_cast<SvxLRSpaceItem*>( &rItem );
- OSL_ENSURE( pLRSpace != NULL, "Wrong Which-ID!" );
+ SvxLRSpaceItem& rLRSpace = dynamic_cast<SvxLRSpaceItem&>(rItem);
switch( nMemberId )
{
@@ -284,10 +283,10 @@ bool SvXMLImportItemMapper::PutXMLValue(
switch( nMemberId )
{
case MID_L_MARGIN:
- pLRSpace->SetTextLeft( (sal_Int32)nAbs, (sal_uInt16)nProp );
+ rLRSpace.SetTextLeft( (sal_Int32)nAbs, (sal_uInt16)nProp );
break;
case MID_R_MARGIN:
- pLRSpace->SetRight( (sal_Int32)nAbs, (sal_uInt16)nProp );
+ rLRSpace.SetRight( (sal_Int32)nAbs, (sal_uInt16)nProp );
break;
}
}
@@ -305,7 +304,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
bOk = rUnitConverter.convertMeasureToCore(nAbs, rValue,
-0x7fff, 0x7fff );
- pLRSpace->SetTextFirstLineOfst( (short)nAbs, (sal_uInt16)nProp );
+ rLRSpace.SetTextFirstLineOfst( (short)nAbs, (sal_uInt16)nProp );
}
break;
@@ -314,7 +313,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
bool bAutoFirst(false);
bOk = ::sax::Converter::convertBool( bAutoFirst, rValue );
if( bOk )
- pLRSpace->SetAutoFirst( bAutoFirst );
+ rLRSpace.SetAutoFirst( bAutoFirst );
}
break;