diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-18 01:41:18 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2024-11-04 14:50:20 +0100 |
commit | 9fc54b966b2b9d423cf594cd385224b06986666f (patch) | |
tree | a81ebf49fd2c62fa5fe97a5bb386ba9a52c03580 | |
parent | 1ebff884cb1261d48130ea80fffc5bc0025a63df (diff) |
tdf#163486: PVS: check mpViewSh
V595 The 'mpView' pointer was utilized before it was verified against nullptr. Check lines: 719, 720.
Change-Id: Ie1bda82df979fd5f293fb6eb9623917371e9da34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175113
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 2e28f5a9f662f3995db06743ed043cbd094b1a68)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175489
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | sd/source/ui/func/futext.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index d90aefc7f542..8693a535c731 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -716,18 +716,21 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) ForcePointer(&rMEvt); mpWindow->ReleaseMouse(); - const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - if ( mpView && rMarkList.GetMarkCount() == 0 ) + if (mpView) { - sal_uInt16 nDrgLog1 = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() ); - if ( std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 && - std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 && - !rMEvt.IsShift() && !rMEvt.IsMod2() ) + const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); + if ( rMarkList.GetMarkCount() == 0 ) { - SdrPageView* pPV2 = mpView->GetSdrPageView(); - SdrViewEvent aVEvt; - mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); - mpView->MarkObj(aVEvt.mpRootObj, pPV2); + sal_uInt16 nDrgLog1 = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() ); + if ( std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 && + std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 && + !rMEvt.IsShift() && !rMEvt.IsMod2() ) + { + SdrPageView* pPV2 = mpView->GetSdrPageView(); + SdrViewEvent aVEvt; + mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); + mpView->MarkObj(aVEvt.mpRootObj, pPV2); + } } } |