diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-31 18:17:11 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-31 22:31:38 +0100 |
commit | 665dce4442e48b133b9fe1a2eb792ed3ef81d90c (patch) | |
tree | 4b2f027c6c9b4b7ac78f8a361f5fa508a10660bd /sd/source | |
parent | 5c930b7e68998dfc9cfc1c10ea065c307e6608c3 (diff) |
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>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 68c4071b6c89..261c6aaf7701 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -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()) |