diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 14:41:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 14:41:33 +0000 |
commit | a79318470e63059309db4fe6ba92942cfac517a9 (patch) | |
tree | 7b02bf5d3369b67ee26fce2ee759d6dfc7a512cf /sd/source | |
parent | ce4711afcb02109d4c9e2dc7d9b048ed4abe21ac (diff) |
coverity#1265811 Dereference null return value
Change-Id: I975c8c28f00b364f57366ea2847f8bd155c12733
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/drviews4.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 4552403c82e6..4acf5edc2770 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -369,7 +369,14 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) ShowMousePosInfo(aRect, pWin); - if ( mbPipette && GetViewFrame()->HasChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() ) ) + SvxBmpMask* pBmpMask = NULL; + if (mbPipette && GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())) + { + SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()); + pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL; + } + + if (pBmpMask) { const long nStartX = maMousePos.X() - PIPETTE_RANGE; const long nEndX = maMousePos.X() + PIPETTE_RANGE; @@ -392,8 +399,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) } } - static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> - SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ), + pBmpMask->SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ), (sal_uInt8) ( nGreen / fDiv + .5 ), (sal_uInt8) ( nBlue / fDiv + .5 ) ) ); } |