sd/source/ui/func/futext.cxx |   23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 9fc54b966b2b9d423cf594cd385224b06986666f
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Oct 18 01:41:18 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 4 14:50:20 2024 +0100

    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 <xiscofa...@libreoffice.org>
    (cherry picked from commit 2e28f5a9f662f3995db06743ed043cbd094b1a68)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175489
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

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);
+            }
         }
     }
 

Reply via email to