diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 10:00:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 10:59:46 +0100 |
commit | d7b75ef4ff20318c16ede48b7daa7b8c3240496d (patch) | |
tree | 94f0a1fd8d9b109a8f2a5ac50b55a96eb12dd153 /sw/source | |
parent | cbe3b018d2b6878778167c35994cda510226fba7 (diff) |
coverity#735966 Unchecked dynamic_cast
Change-Id: Ib949aab22c8fe001d15d536abbf6984df86f5a03
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 27 |
1 files changed, 13 insertions, 14 deletions
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<const SvxLRSpaceItem*>( &rItem ); - OSL_ENSURE( pLRSpace != NULL, "Wrong Which-ID!" ); + const SvxLRSpaceItem& rLRSpace = dynamic_cast<const SvxLRSpaceItem&>(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 |