From d7b75ef4ff20318c16ede48b7daa7b8c3240496d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 14 Oct 2015 10:00:22 +0100 Subject: coverity#735966 Unchecked dynamic_cast Change-Id: Ib949aab22c8fe001d15d536abbf6984df86f5a03 --- sw/source/filter/xml/xmlexpit.cxx | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index d541e47892cc..bc58820ca82e 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -384,60 +384,59 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_LR_SPACE: { - const SvxLRSpaceItem* pLRSpace = dynamic_cast( &rItem ); - OSL_ENSURE( pLRSpace != NULL, "Wrong Which-ID!" ); + const SvxLRSpaceItem& rLRSpace = dynamic_cast(rItem); bOk = true; switch( nMemberId ) { case MID_L_MARGIN: - if(pLRSpace->GetPropLeft() != 100) + if (rLRSpace.GetPropLeft() != 100) { ::sax::Converter::convertPercent( - aOut, pLRSpace->GetPropLeft() ); + aOut, rLRSpace.GetPropLeft() ); } else { rUnitConverter.convertMeasureToXML( - aOut, pLRSpace->GetLeft() ); + aOut, rLRSpace.GetLeft() ); } break; case MID_R_MARGIN: - if(pLRSpace->GetPropRight() != 100) + if (rLRSpace.GetPropRight() != 100) { ::sax::Converter::convertPercent( - aOut, pLRSpace->GetPropRight() ); + aOut, rLRSpace.GetPropRight() ); } else { rUnitConverter.convertMeasureToXML( - aOut, pLRSpace->GetRight() ); + aOut, rLRSpace.GetRight() ); } break; case MID_FIRST_AUTO: - if( pLRSpace->IsAutoFirst() ) + if (rLRSpace.IsAutoFirst()) { ::sax::Converter::convertBool( - aOut, pLRSpace->IsAutoFirst() ); + aOut, rLRSpace.IsAutoFirst() ); } else bOk = false; break; case MID_FIRST_LINE_INDENT: - if( !pLRSpace->IsAutoFirst() ) + if (!rLRSpace.IsAutoFirst()) { - if(pLRSpace->GetPropTextFirstLineOfst() != 100) + if (rLRSpace.GetPropTextFirstLineOfst() != 100) { ::sax::Converter::convertPercent( - aOut, pLRSpace->GetPropTextFirstLineOfst() ); + aOut, rLRSpace.GetPropTextFirstLineOfst() ); } else { rUnitConverter.convertMeasureToXML( - aOut, pLRSpace->GetTextFirstLineOfst() ); + aOut, rLRSpace.GetTextFirstLineOfst() ); } } else -- cgit