[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 7 19:10:47 UTC 2021


 sc/source/ui/drawfunc/fudraw.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 2cd1442f83d41af1f2b663ccb8bfab6a954009f1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Aug 7 16:40:05 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Aug 7 21:10:13 2021 +0200

    cid#1489785 Dereference after null check
    
    Change-Id: Ia6b3ef68582ced9628e99bc5717e0a1563323f7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120163
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index f32b0ad3c68c..582a1ba77713 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -675,6 +675,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
     Point aPnt      = pWindow->PixelToLogic( aPosPixel );
     SdrHdl* pHdl    = pView->PickHandle(aPnt);
     SdrPageView* pPV;
+    SdrObject* pMacroPickObj;
 
     ScMacroInfo* pInfo = nullptr;
     SdrObject* pObj = pView->PickObj(aPnt, pView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER);
@@ -708,11 +709,11 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
         //  could be suppressed with ALT
         pWindow->SetPointer( PointerStyle::RefHand );          // Text-URL / ImageMap
     }
-    else if ( !bAlt && (pObj = pView->PickObj(aPnt, pView->getHitTolLog(), pPV, SdrSearchOptions::PICKMACRO)) )
+    else if ( !bAlt && (pMacroPickObj = pView->PickObj(aPnt, pView->getHitTolLog(), pPV, SdrSearchOptions::PICKMACRO)) )
     {
         //  could be suppressed with ALT
         SdrObjMacroHitRec aHitRec;  //! something missing ????
-        rViewShell.SetActivePointer( pObj->GetMacroPointer(aHitRec) );
+        rViewShell.SetActivePointer(pMacroPickObj->GetMacroPointer(aHitRec));
     }
     else if ( !bAlt && pInfo && (!pInfo->GetMacro().isEmpty() || !pObj->getHyperlink().isEmpty()) )
         pWindow->SetPointer( PointerStyle::RefHand );


More information about the Libreoffice-commits mailing list