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

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Sep 2 02:44:34 UTC 2017


 sc/inc/datauno.hxx              |    2 +-
 sc/source/ui/unoobj/datauno.cxx |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit cb14008337e7b7ebbc0b5724f98ac9633e1b9331
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Sep 2 03:39:36 2017 +0200

    make sure parent element is staying around
    
    If we use a reference to the object we need to ensure that it not
    suddenly disappears on us.
    
    Change-Id: I7917fc696b0cc48dd26fa332c892f09727e40054
    Reviewed-on: https://gerrit.libreoffice.org/41820
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx
index 34b7da848779..26afe6030065 100644
--- a/sc/inc/datauno.hxx
+++ b/sc/inc/datauno.hxx
@@ -209,7 +209,7 @@ class ScSubTotalFieldObj : public cppu::WeakImplHelper<
                                 css::lang::XServiceInfo >
 {
 private:
-    ScSubTotalDescriptorBase&       rParent;
+    rtl::Reference<ScSubTotalDescriptorBase> xParent;
     sal_uInt16                      nPos;
 
 public:
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 32ee2b1590bc..c2a280967ae3 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -447,7 +447,7 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
 }
 
 ScSubTotalFieldObj::ScSubTotalFieldObj( ScSubTotalDescriptorBase* pDesc, sal_uInt16 nP ) :
-    rParent( *pDesc ),
+    xParent( pDesc ),
     nPos( nP )
 {
     OSL_ENSURE(pDesc, "ScSubTotalFieldObj: Parent is 0");
@@ -463,7 +463,7 @@ sal_Int32 SAL_CALL ScSubTotalFieldObj::getGroupColumn()
 {
     SolarMutexGuard aGuard;
     ScSubTotalParam aParam;
-    rParent.GetData(aParam);
+    xParent->GetData(aParam);
 
     return aParam.nField[nPos];
 }
@@ -472,18 +472,18 @@ void SAL_CALL ScSubTotalFieldObj::setGroupColumn( sal_Int32 nGroupColumn )
 {
     SolarMutexGuard aGuard;
     ScSubTotalParam aParam;
-    rParent.GetData(aParam);
+    xParent->GetData(aParam);
 
     aParam.nField[nPos] = (SCCOL)nGroupColumn;
 
-    rParent.PutData(aParam);
+    xParent->PutData(aParam);
 }
 
 uno::Sequence<sheet::SubTotalColumn> SAL_CALL ScSubTotalFieldObj::getSubTotalColumns()
 {
     SolarMutexGuard aGuard;
     ScSubTotalParam aParam;
-    rParent.GetData(aParam);
+    xParent->GetData(aParam);
 
     SCCOL nCount = aParam.nSubTotals[nPos];
     uno::Sequence<sheet::SubTotalColumn> aSeq(nCount);
@@ -502,7 +502,7 @@ void SAL_CALL ScSubTotalFieldObj::setSubTotalColumns(
 {
     SolarMutexGuard aGuard;
     ScSubTotalParam aParam;
-    rParent.GetData(aParam);
+    xParent->GetData(aParam);
 
     sal_uInt32 nColCount = aSubTotalColumns.getLength();
     if ( nColCount <= sal::static_int_cast<sal_uInt32>(SCCOL_MAX) )
@@ -529,7 +529,7 @@ void SAL_CALL ScSubTotalFieldObj::setSubTotalColumns(
     }
     //! otherwise exception or so? (too many columns)
 
-    rParent.PutData(aParam);
+    xParent->PutData(aParam);
 }
 
 ScSubTotalDescriptorBase::ScSubTotalDescriptorBase() :


More information about the Libreoffice-commits mailing list