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

coverity#1265811 Dereference null return value

Change-Id: I975c8c28f00b364f57366ea2847f8bd155c12733
üst ce4711af
...@@ -369,7 +369,14 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) ...@@ -369,7 +369,14 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
ShowMousePosInfo(aRect, 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 nStartX = maMousePos.X() - PIPETTE_RANGE;
const long nEndX = maMousePos.X() + PIPETTE_RANGE; const long nEndX = maMousePos.X() + PIPETTE_RANGE;
...@@ -392,8 +399,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) ...@@ -392,8 +399,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
} }
} }
static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> pBmpMask->SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ),
SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ),
(sal_uInt8) ( nGreen / fDiv + .5 ), (sal_uInt8) ( nGreen / fDiv + .5 ),
(sal_uInt8) ( nBlue / fDiv + .5 ) ) ); (sal_uInt8) ( nBlue / fDiv + .5 ) ) );
} }
......
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