diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-07 16:20:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-08 09:56:21 +0100 |
commit | c9445734e5116b9c8e377d027bb02508baeb48c9 (patch) | |
tree | b1837cd0ee9520b64a9c3ba8307ce407c74b6ebe | |
parent | a0118b26308844c27547073c14c26458492ef4b9 (diff) |
coverity#735959 Explicit null dereferenced
Change-Id: I9ba5a7ab1938174f083fdc81c046b286fc73a4e9
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 16d4dc5e5c9c..ac5ae648914e 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -493,39 +493,41 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_SHADOW: { const SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem); - OSL_ENSURE( pShadow != NULL, "Wrong Which-ID" ); - - sal_Int32 nX = 1, nY = 1; - switch( pShadow->GetLocation() ) + assert(pShadow); //Wrong Which-ID + if (pShadow) + { + sal_Int32 nX = 1, nY = 1; + switch( pShadow->GetLocation() ) { - case SVX_SHADOW_TOPLEFT: - nX = -1; - nY = -1; - break; - case SVX_SHADOW_TOPRIGHT: - nY = -1; - break; - case SVX_SHADOW_BOTTOMLEFT: - nX = -1; - break; - case SVX_SHADOW_BOTTOMRIGHT: - break; - case SVX_SHADOW_NONE: - default: - rValue = GetXMLToken(XML_NONE); - return true; + case SVX_SHADOW_TOPLEFT: + nX = -1; + nY = -1; + break; + case SVX_SHADOW_TOPRIGHT: + nY = -1; + break; + case SVX_SHADOW_BOTTOMLEFT: + nX = -1; + break; + case SVX_SHADOW_BOTTOMRIGHT: + break; + case SVX_SHADOW_NONE: + default: + rValue = GetXMLToken(XML_NONE); + return true; } - nX *= pShadow->GetWidth(); - nY *= pShadow->GetWidth(); + nX *= pShadow->GetWidth(); + nY *= pShadow->GetWidth(); - ::sax::Converter::convertColor(aOut, pShadow->GetColor().GetColor()); - aOut.append( ' ' ); - rUnitConverter.convertMeasureToXML( aOut, nX ); - aOut.append( ' ' ); - rUnitConverter.convertMeasureToXML( aOut, nY ); + ::sax::Converter::convertColor(aOut, pShadow->GetColor().GetColor()); + aOut.append( ' ' ); + rUnitConverter.convertMeasureToXML( aOut, nX ); + aOut.append( ' ' ); + rUnitConverter.convertMeasureToXML( aOut, nY ); - bOk = true; + bOk = true; + } } break; |