sd/source/ui/func/futext.cxx     |   20 +++++++++++---------
 sd/source/ui/inc/unomodel.hxx    |    4 ++--
 sd/source/ui/unoidl/unomodel.cxx |    7 +++----
 3 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit f007378b74c1d316a510f4fe2491ec7724958c1c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Jul 22 20:02:46 2023 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Jul 23 11:53:38 2023 +0200

    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 <[email protected]>

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 )
commit 7e355206fe882b01fff676ab572feed595a94ff8
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Jul 22 19:57:01 2023 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Jul 23 11:53:27 2023 +0200

    cid#1538306 Uncaught exception
    
    and
    
    cid#1538308 Uncaught exception
    
    Change-Id: Ifd274b71e9fc1d744799451f460fdcb0ee1ca91d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154791
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index eba78ce17fb7..008c9459e1c4 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -397,7 +397,7 @@ private:
     OUString aNames[SdLinkTargetType::Count];
 
 public:
-    SdDocLinkTargets( SdXImpressDocument&   rMyModel ) noexcept;
+    SdDocLinkTargets(SdXImpressDocument& rMyModel);
     virtual ~SdDocLinkTargets() noexcept override;
 
     // XNameAccess
@@ -429,7 +429,7 @@ class SdDocLinkTargetType final : public 
::cppu::WeakImplHelper< css::document::
     OUString maName;
 
 public:
-    SdDocLinkTargetType(SdXImpressDocument* pModel, sal_uInt16 nT) noexcept;
+    SdDocLinkTargetType(SdXImpressDocument* pModel, sal_uInt16 nT);
 
     // css::document::XLinkTargetSupplier
     virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL 
getLinks() override;
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 3350da8b92e5..9f906dc404a0 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -3390,9 +3390,8 @@ uno::Sequence< OUString > SAL_CALL 
SdMasterPagesAccess::getSupportedServiceNames
     return { "com.sun.star.drawing.MasterPages" };
 }
 
-
-SdDocLinkTargets::SdDocLinkTargets( SdXImpressDocument& rMyModel ) noexcept
-: mpModel( &rMyModel )
+SdDocLinkTargets::SdDocLinkTargets(SdXImpressDocument& rMyModel)
+    : mpModel(&rMyModel)
 {
     for (sal_uInt16 i=0; i < SdLinkTargetType::Count; i++)
         aNames[i] = SdResId(aTypeResIds[i]);
@@ -3508,7 +3507,7 @@ uno::Sequence< OUString > SAL_CALL 
SdDocLinkTargets::getSupportedServiceNames()
     return { "com.sun.star.document.LinkTargets" };
 }
 
-SdDocLinkTargetType::SdDocLinkTargetType(SdXImpressDocument* pModel, 
sal_uInt16 nT) noexcept
+SdDocLinkTargetType::SdDocLinkTargetType(SdXImpressDocument* pModel, 
sal_uInt16 nT)
     : mpModel(pModel)
     , mnType(nT)
 {

Reply via email to