diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-13 11:06:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-13 14:03:25 +0000 |
commit | 6cf39bbe4cef84ca94ad55618eaa3f063db119b0 (patch) | |
tree | 4e67f53e1167db4856175aead56fc27f8c53e633 | |
parent | 53a46e24cded1b92c9af337f392dc531b1422f10 (diff) |
coverity#705505 Dereference null return value
Change-Id: Idd584ef2756076fc0fb73e0ee8981a38b0cf0649
-rw-r--r-- | sw/source/core/text/porfld.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index df502eb6e98a..3a74264ca945 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -941,7 +941,9 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const if( OUTDEV_VIRDEV == rInf.GetOut()->GetOutDevType() && pViewShell && pViewShell->GetWin() ) { - ( (Graphic*) pBrush->GetGraphic() )->StopAnimation(0,nId); + Graphic* pGraph = (Graphic*)pBrush->GetGraphic(); + if (pGraph) + pGraph->StopAnimation(0,nId); rInf.GetTxtFrm()->getRootFrm()->GetCurrShell()->InvalidateWindows( aTmp ); } @@ -951,8 +953,12 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const // #i9684# Stop animation during printing/pdf export. pViewShell->GetWin() ) { - ( (Graphic*) pBrush->GetGraphic() )->StartAnimation( - (OutputDevice*)rInf.GetOut(), aPos, aSize, nId ); + Graphic* pGraph = (Graphic*)pBrush->GetGraphic(); + if (pGraph) + { + pGraph->StartAnimation( + (OutputDevice*)rInf.GetOut(), aPos, aSize, nId ); + } } // pdf export, printing, preview, stop animations... @@ -960,7 +966,12 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const bDraw = true; } if( bDraw ) - ( (Graphic*) pBrush->GetGraphic() )->StopAnimation( 0, nId ); + { + + Graphic* pGraph = (Graphic*)pBrush->GetGraphic(); + if (pGraph) + pGraph->StopAnimation( 0, nId ); + } } SwRect aRepaint( rInf.GetPaintRect() ); |