diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 12:23:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 15:02:44 +0100 |
commit | 94d3b93dd8985f64694478921c65569649094593 (patch) | |
tree | 1352d908ad5408d60611acb1abab48fed22cc542 /sw | |
parent | 5d370cddc61cdc46597ac523a6b842f43c30a743 (diff) |
coverity#7359793 Unchecked dynamic_cast
Change-Id: Ie3564a98078464b98ab4ef6f1aa87544dbcebe6c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 83b1c36bc944..90a17b7c2c73 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -638,8 +638,7 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_BACKGROUND: { - SvxBrushItem* pBrush = dynamic_cast<SvxBrushItem*>( &rItem ); - OSL_ENSURE( pBrush != NULL, "Wrong Which-ID" ); + SvxBrushItem& rBrush = dynamic_cast<SvxBrushItem&>(rItem); sal_Int32 nTempColor(0); switch( nMemberId ) @@ -647,41 +646,41 @@ bool SvXMLImportItemMapper::PutXMLValue( case MID_BACK_COLOR: if( IsXMLToken( rValue, XML_TRANSPARENT ) ) { - pBrush->GetColor().SetTransparency(0xff); + rBrush.GetColor().SetTransparency(0xff); bOk = true; } else if (::sax::Converter::convertColor(nTempColor, rValue)) { Color aTempColor(nTempColor); aTempColor.SetTransparency(0); - pBrush->SetColor( aTempColor ); + rBrush.SetColor( aTempColor ); bOk = true; } break; case MID_GRAPHIC_LINK: { - SvxGraphicPosition eOldGraphicPos = pBrush->GetGraphicPos(); + SvxGraphicPosition eOldGraphicPos = rBrush.GetGraphicPos(); uno::Any aAny; aAny <<= rValue; - pBrush->PutValue( aAny, MID_GRAPHIC_URL ); + rBrush.PutValue( aAny, MID_GRAPHIC_URL ); if( GPOS_NONE == eOldGraphicPos && - GPOS_NONE != pBrush->GetGraphicPos() ) - pBrush->SetGraphicPos( GPOS_TILED ); + GPOS_NONE != rBrush.GetGraphicPos() ) + rBrush.SetGraphicPos( GPOS_TILED ); bOk = true; } break; case MID_GRAPHIC_REPEAT: { - SvxGraphicPosition eGraphicPos = pBrush->GetGraphicPos(); + SvxGraphicPosition eGraphicPos = rBrush.GetGraphicPos(); sal_uInt16 nPos = GPOS_NONE; if( SvXMLUnitConverter::convertEnum( nPos, rValue, psXML_BrushRepeat ) ) { if( GPOS_MM != nPos || GPOS_NONE == eGraphicPos || GPOS_AREA == eGraphicPos || GPOS_TILED == eGraphicPos ) - pBrush->SetGraphicPos( (SvxGraphicPosition)nPos ); + rBrush.SetGraphicPos( (SvxGraphicPosition)nPos ); bOk = true; } } @@ -767,12 +766,12 @@ bool SvXMLImportItemMapper::PutXMLValue( if( GPOS_NONE == ePos ) bOk = false; if( bOk ) - pBrush->SetGraphicPos( ePos ); + rBrush.SetGraphicPos( ePos ); } break; case MID_GRAPHIC_FILTER: - pBrush->SetGraphicFilter( rValue ); + rBrush.SetGraphicFilter( rValue ); bOk = true; break; } |