tdf#163486: PVS: check GetView
V1004 The 'GetView()' pointer was used unsafely after it was verified against nullptr. Check lines: 596, 606. Change-Id: I4bf5366f49794c2956b0f704c32829c9dac6d5b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175883 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
5c930b7e68
commit
665dce4442
1 changed files with 7 additions and 5 deletions
|
@ -592,18 +592,20 @@ void ViewShell::MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin)
|
|||
SetActiveWindow(pWin);
|
||||
}
|
||||
|
||||
::sd::View* pView = GetView();
|
||||
if (!pView)
|
||||
return;
|
||||
|
||||
// insert MouseEvent into E3dView
|
||||
if (GetView() != nullptr)
|
||||
GetView()->SetMouseEvent(rMEvt);
|
||||
pView->SetMouseEvent(rMEvt);
|
||||
|
||||
bool bConsumed = false;
|
||||
if( GetView() )
|
||||
bConsumed = GetView()->getSmartTags().MouseButtonDown( rMEvt );
|
||||
bConsumed = pView->getSmartTags().MouseButtonDown( rMEvt );
|
||||
|
||||
if( bConsumed )
|
||||
return;
|
||||
|
||||
rtl::Reference< sdr::SelectionController > xSelectionController( GetView()->getSelectionController() );
|
||||
rtl::Reference< sdr::SelectionController > xSelectionController( pView->getSelectionController() );
|
||||
if( !xSelectionController.is() || !xSelectionController->onMouseButtonDown( rMEvt, pWin ) )
|
||||
{
|
||||
if(HasCurrentFunction())
|
||||
|
|
Loading…
Reference in a new issue