diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 09:58:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 10:59:45 +0100 |
commit | cbe3b018d2b6878778167c35994cda510226fba7 (patch) | |
tree | a79d8497c30ad09d2ecfdb9905848af8b8bd1c3a /sw | |
parent | 0087fb06dce8e705293434df67409786143c2a59 (diff) |
coverity#735967 Unchecked dynamic_cast
Change-Id: Id092c99e6106ff73f4ea9ebdc2eb39330f894423
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 1e612667ee8a..d541e47892cc 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -454,34 +454,33 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_UL_SPACE: { - const SvxULSpaceItem* pULSpace = dynamic_cast<const SvxULSpaceItem*>( &rItem ); - OSL_ENSURE( pULSpace != NULL, "Wrong Which-ID!" ); + const SvxULSpaceItem& rULSpace = dynamic_cast<const SvxULSpaceItem&>(rItem); switch( nMemberId ) { case MID_UP_MARGIN: - if( pULSpace->GetPropUpper() != 100 ) + if (rULSpace.GetPropUpper() != 100) { ::sax::Converter::convertPercent( - aOut, pULSpace->GetPropUpper() ); + aOut, rULSpace.GetPropUpper() ); } else { rUnitConverter.convertMeasureToXML( - aOut, pULSpace->GetUpper() ); + aOut, rULSpace.GetUpper() ); } break; case MID_LO_MARGIN: - if( pULSpace->GetPropLower() != 100 ) + if (rULSpace.GetPropLower() != 100) { ::sax::Converter::convertPercent( - aOut, pULSpace->GetPropLower() ); + aOut, rULSpace.GetPropLower() ); } else { rUnitConverter.convertMeasureToXML( - aOut, pULSpace->GetLower() ); + aOut, rULSpace.GetLower() ); } break; |