coverity#705861 Dereference before null check

Change-Id: Ia027a5990769413dff323ff0e0b6fd66633b9339
This commit is contained in:
Caolán McNamara
2014-05-30 09:20:33 +01:00
parent 6bbb8b88fd
commit 6a8e7fde50

View File

@@ -325,19 +325,21 @@ bool FuDraw::MouseMove(const MouseEvent& rMEvt)
bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt) bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
{ {
if ( mpView->IsDragHelpLine() ) if (mpView && mpView->IsDragHelpLine())
mpView->EndDragHelpLine(); mpView->EndDragHelpLine();
if ( bDragHelpLine ) if ( bDragHelpLine )
{ {
Rectangle aOutputArea(Point(0,0), mpWindow->GetOutputSizePixel()); Rectangle aOutputArea(Point(0,0), mpWindow->GetOutputSizePixel());
if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) ) if (mpView && !aOutputArea.IsInside(rMEvt.GetPosPixel()))
mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine); mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine);
mpWindow->ReleaseMouse(); mpWindow->ReleaseMouse();
} }
if (mpView)
{
FrameView* pFrameView = mpViewShell->GetFrameView(); FrameView* pFrameView = mpViewShell->GetFrameView();
mpView->SetOrtho( pFrameView->IsOrtho() ); mpView->SetOrtho( pFrameView->IsOrtho() );
mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() ); mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
@@ -351,6 +353,7 @@ bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
mpView->SetOFrmSnap(pFrameView->IsOFrmSnap()); mpView->SetOFrmSnap(pFrameView->IsOFrmSnap());
mpView->SetOPntSnap(pFrameView->IsOPntSnap()); mpView->SetOPntSnap(pFrameView->IsOPntSnap());
mpView->SetOConSnap(pFrameView->IsOConSnap()); mpView->SetOConSnap(pFrameView->IsOConSnap());
}
bIsInDragMode = false; bIsInDragMode = false;
ForcePointer(&rMEvt); ForcePointer(&rMEvt);