Kaydet (Commit) 841a3106 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#735963 Unchecked dynamic_cast

Change-Id: I0ff0a1aeafed4f38772123596b477b8df68ca69a
üst 6dd3c355
...@@ -897,8 +897,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( ...@@ -897,8 +897,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BACKGROUND: case RES_BACKGROUND:
{ {
const SvxBrushItem* pBrush = dynamic_cast<const SvxBrushItem*>( &rItem ); const SvxBrushItem& rBrush = dynamic_cast<const SvxBrushItem&>(rItem);
OSL_ENSURE( pBrush != NULL, "Wrong Which-ID" );
// note: the graphic is only exported if nMemberId equals // note: the graphic is only exported if nMemberId equals
// MID_GRAPHIC.. // MID_GRAPHIC..
...@@ -907,21 +906,21 @@ bool SvXMLExportItemMapper::QueryXMLValue( ...@@ -907,21 +906,21 @@ bool SvXMLExportItemMapper::QueryXMLValue(
switch( nMemberId ) switch( nMemberId )
{ {
case MID_BACK_COLOR: case MID_BACK_COLOR:
if ( pBrush->GetColor().GetTransparency() ) if ( rBrush.GetColor().GetTransparency() )
aOut.append( GetXMLToken(XML_TRANSPARENT) ); aOut.append( GetXMLToken(XML_TRANSPARENT) );
else else
{ {
::sax::Converter::convertColor(aOut, ::sax::Converter::convertColor(aOut,
pBrush->GetColor().GetColor()); rBrush.GetColor().GetColor());
} }
bOk = true; bOk = true;
break; break;
case MID_GRAPHIC_LINK: case MID_GRAPHIC_LINK:
if( pBrush->GetGraphicPos() != GPOS_NONE ) if (rBrush.GetGraphicPos() != GPOS_NONE)
{ {
uno::Any aAny; uno::Any aAny;
pBrush->QueryValue( aAny, MID_GRAPHIC_URL ); rBrush.QueryValue( aAny, MID_GRAPHIC_URL );
OUString sTmp; OUString sTmp;
aAny >>= sTmp; aAny >>= sTmp;
aOut.append( sTmp ); aOut.append( sTmp );
...@@ -930,7 +929,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( ...@@ -930,7 +929,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
break; break;
case MID_GRAPHIC_POSITION: case MID_GRAPHIC_POSITION:
switch( pBrush->GetGraphicPos() ) switch (rBrush.GetGraphicPos())
{ {
case GPOS_LT: case GPOS_LT:
case GPOS_MT: case GPOS_MT:
...@@ -958,7 +957,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( ...@@ -958,7 +957,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
{ {
aOut.append( ' ' ); aOut.append( ' ' );
switch( pBrush->GetGraphicPos() ) switch (rBrush.GetGraphicPos())
{ {
case GPOS_LT: case GPOS_LT:
case GPOS_LB: case GPOS_LB:
...@@ -983,7 +982,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( ...@@ -983,7 +982,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case MID_GRAPHIC_REPEAT: case MID_GRAPHIC_REPEAT:
{ {
SvxGraphicPosition eGraphicPos = pBrush->GetGraphicPos(); SvxGraphicPosition eGraphicPos = rBrush.GetGraphicPos();
if( GPOS_AREA == eGraphicPos ) if( GPOS_AREA == eGraphicPos )
{ {
aOut.append( GetXMLToken(XML_BACKGROUND_STRETCH) ); aOut.append( GetXMLToken(XML_BACKGROUND_STRETCH) );
...@@ -998,10 +997,10 @@ bool SvXMLExportItemMapper::QueryXMLValue( ...@@ -998,10 +997,10 @@ bool SvXMLExportItemMapper::QueryXMLValue(
break; break;
case MID_GRAPHIC_FILTER: case MID_GRAPHIC_FILTER:
if( pBrush->GetGraphicPos() != GPOS_NONE && if (rBrush.GetGraphicPos() != GPOS_NONE &&
!pBrush->GetGraphicFilter().isEmpty() ) !rBrush.GetGraphicFilter().isEmpty())
{ {
aOut.append( pBrush->GetGraphicFilter() ); aOut.append(rBrush.GetGraphicFilter());
bOk = true; bOk = true;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment