diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-07-22 20:02:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-07-23 11:53:38 +0200 |
commit | f007378b74c1d316a510f4fe2491ec7724958c1c (patch) | |
tree | d4a9eae28ef50606bf2d35aa198dd6c6d20658ad /sd/source | |
parent | 7e355206fe882b01fff676ab572feed595a94ff8 (diff) |
cid#1539070 Dereference before null check
Change-Id: I32bb7a7e6689b5b9cf9847726cc813ddb2404e56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154792
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/func/futext.cxx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index c1da5f338bee..549248f15223 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -720,17 +720,19 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) ForcePointer(&rMEvt); mpWindow->ReleaseMouse(); - sal_uInt16 nDrgLog1 = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() ); - if ( mpView && !mpView->AreObjectsMarked() && - std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 && - std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 && - !rMEvt.IsShift() && !rMEvt.IsMod2() ) + if ( mpView && !mpView->AreObjectsMarked() ) { - 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); + } } if ( !mxTextObj.get().is() && mpView ) |