diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-10 20:53:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-10 20:53:03 +0000 |
commit | 750105967d6add2670cff5847ea74da925a3e679 (patch) | |
tree | 3b495350cff5321cc6c254e9144c0dfb98f87db0 /cui | |
parent | c748d6115e6c9f2820701e410611b75c09156987 (diff) |
coverity#704610 Dereference after null check
Change-Id: I1a08d643a695f1d22e339b8906588aca7d190578
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/grfpage.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 065bee0663a4..8d8ce6f2fc7b 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -204,23 +204,25 @@ void SvxGrfCropPage::Reset( const SfxItemSet &rSet ) referer = it->GetValue(); } const Graphic* pGrf = ((SvxBrushItem*)pItem)->GetGraphic(referer); - if( pGrf ) { + if( pGrf ) + { aOrigSize = GetGrfOrigSize( *pGrf ); - if (pGrf->GetType() == GRAPHIC_BITMAP && aOrigSize.Width() && aOrigSize.Height()) { + if (pGrf->GetType() == GRAPHIC_BITMAP && aOrigSize.Width() && aOrigSize.Height()) + { Bitmap aBitmap = pGrf->GetBitmap(); aOrigPixelSize = aBitmap.GetSizePixel(); } - } - if( aOrigSize.Width() && aOrigSize.Height() ) - { - CalcMinMaxBorder(); - m_pExampleWN->SetGraphic( *pGrf ); - m_pExampleWN->SetFrameSize( aOrigSize ); + if( aOrigSize.Width() && aOrigSize.Height() ) + { + CalcMinMaxBorder(); + m_pExampleWN->SetGraphic( *pGrf ); + m_pExampleWN->SetFrameSize( aOrigSize ); - bFound = sal_True; - if( !((SvxBrushItem*)pItem)->GetGraphicLink().isEmpty() ) - aGraphicName = ((SvxBrushItem*)pItem)->GetGraphicLink(); + bFound = sal_True; + if( !((SvxBrushItem*)pItem)->GetGraphicLink().isEmpty() ) + aGraphicName = ((SvxBrushItem*)pItem)->GetGraphicLink(); + } } } |