diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 14:30:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 14:30:05 +0000 |
commit | a28ad8c96a6777fba734a4cc50c4fc56736dbaee (patch) | |
tree | 0717598caa0e3de5f4ecb5fbd58cbcccb18cf1fc /sd | |
parent | 397ca5ca902cbdc0278f3a6efc41a31b2c7d6375 (diff) |
coverity#1265798 Dereference null return value
Change-Id: Ic4a9a42bafdc72be3de067b5f47dc98f0250f575
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/func/fudraw.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews6.cxx | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 20ea07c795cf..ce1662921501 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -523,7 +523,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) mpViewShell->GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())) { // pipette mode - SfxChildWindow* pWnd = mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()); + SfxChildWindow* pWnd = mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()); SvxBmpMask* pMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL; if (pMask && pMask->IsEyedropping()) { diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index 9660b441e5f3..d1340419abd8 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -301,21 +301,21 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq ) } } - if( bCont ) + SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow( + SvxBmpMaskChildWindow::GetChildWindowId()); + SvxBmpMask* pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL; + assert(pBmpMask); + if (bCont && pBmpMask) { const Graphic& rOldGraphic = pNewObj->GetGraphic(); - const Graphic aNewGraphic( static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( - SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> - Mask( rOldGraphic ) ); + const Graphic aNewGraphic(pBmpMask->Mask(rOldGraphic)); if( aNewGraphic != rOldGraphic ) { SdrPageView* pPV = mpDrawView->GetSdrPageView(); pNewObj->SetEmptyPresObj( false ); - pNewObj->SetGraphic( static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( - SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> - Mask( pNewObj->GetGraphic() ) ); + pNewObj->SetGraphic(pBmpMask->Mask(pNewObj->GetGraphic())); OUString aStr( mpDrawView->GetDescriptionOfMarkedObjects() ); aStr += " " + SD_RESSTR(STR_EYEDROPPER); |