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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 16 07:43:52 UTC 2020


 sc/inc/charthelper.hxx              |    2 +-
 sc/source/core/tool/charthelper.cxx |    8 ++++----
 sc/source/ui/drawfunc/fusel.cxx     |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit bd8083916362d121cc7b16d273b5983a11eb1bda
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 15 09:47:53 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 16 09:42:50 2020 +0200

    AddRangesIfProtectedChart never passed a null ScDocument*
    
    Change-Id: Ia73438defc9db3bff8aecd7a537170e9a86fd1a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102788
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx
index 4889c9de8eff..4f850f155b38 100644
--- a/sc/inc/charthelper.hxx
+++ b/sc/inc/charthelper.hxx
@@ -45,7 +45,7 @@ public:
     static void SetChartRanges( const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc,
             const css::uno::Sequence< OUString >& rRanges );
 
-    static void AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, const ScDocument* pDocument, SdrObject* pObject );
+    static void AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, const ScDocument& rDocument, SdrObject* pObject );
     static void FillProtectedChartRangesVector( ScRangeListVector& rRangesVector, const ScDocument& rDocument, const SdrPage* pPage );
     static void GetChartNames( ::std::vector< OUString >& rChartNames, const SdrPage* pPage );
     static void CreateProtectedChartListenersAndNotify( ScDocument& rDoc, const SdrPage* pPage, ScModelObj* pModelObj, SCTAB nTab,
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index 669a622f02ff..572da8014b47 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -281,9 +281,9 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument
     xChartDoc->unlockControllers();
 }
 
-void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, const ScDocument* pDocument, SdrObject* pObject )
+void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, const ScDocument& rDocument, SdrObject* pObject )
 {
-    if ( !(pDocument && pObject && ( pObject->GetObjIdentifier() == OBJ_OLE2 )) )
+    if ( !(pObject && ( pObject->GetObjIdentifier() == OBJ_OLE2 )) )
         return;
 
     SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >( pObject );
@@ -302,7 +302,7 @@ void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector,
          ( xProps->getPropertyValue("DisableDataTableDialog") >>= bDisableDataTableDialog ) &&
          bDisableDataTableDialog )
     {
-        ScChartListenerCollection* pCollection = pDocument->GetChartListenerCollection();
+        ScChartListenerCollection* pCollection = rDocument.GetChartListenerCollection();
         if (pCollection)
         {
             const OUString& aChartName = pSdrOle2Obj->GetPersistName();
@@ -331,7 +331,7 @@ void ScChartHelper::FillProtectedChartRangesVector( ScRangeListVector& rRangesVe
         SdrObject* pObject = aIter.Next();
         while ( pObject )
         {
-            AddRangesIfProtectedChart( rRangesVector, &rDocument, pObject );
+            AddRangesIfProtectedChart( rRangesVector, rDocument, pObject );
             pObject = aIter.Next();
         }
     }
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 72be7847faef..dca0beaa1ef1 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -370,7 +370,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
                         pObj = ( pMark ? pMark->GetMarkedSdrObj() : nullptr );
                         if ( pObj )
                         {
-                            ScChartHelper::AddRangesIfProtectedChart( aProtectedChartRangesVector, &rDocument, pObj );
+                            ScChartHelper::AddRangesIfProtectedChart( aProtectedChartRangesVector, rDocument, pObj );
                         }
                     }
                 }


More information about the Libreoffice-commits mailing list