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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 4 17:37:22 UTC 2020


 sc/inc/externalrefmgr.hxx                |    6 +++---
 sc/source/ui/docshell/externalrefmgr.cxx |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 06de11f1d419f04a827bc6d6bc323f1c87ad83a5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jan 4 14:41:25 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jan 4 18:36:49 2020 +0100

    ofz#19796 Indirect-leak
    
    Change-Id: I144a1dd7901c90a979a018576404b84ece36a79b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86222
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index b0b81ea705e8..b95d6d1a0fd1 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SC_INC_EXTERNALREFMGR_HXX
 
 #include "address.hxx"
+#include "document.hxx"
 #include <sfx2/objsh.hxx>
 #include <sfx2/lnkbase.hxx>
 #include <tools/time.hxx>
@@ -40,7 +41,6 @@
 #include <set>
 #include <formula/ExternalReferenceHelper.hxx>
 
-class ScDocument;
 class ScTokenArray;
 namespace weld { class Window; }
 
@@ -299,7 +299,7 @@ public:
     void clearCacheTables(sal_uInt16 nFileId);
 
     // Get the fake doc used to pass to methods that need an ScDocument in order to do row/col validation
-    const ScDocument* getFakeDoc() const { return mpFakeDoc; }
+    const ScDocument* getFakeDoc() const { return mxFakeDoc.get(); }
 
 private:
     struct RangeHash
@@ -358,7 +358,7 @@ private:
 private:
     mutable osl::Mutex maMtxDocs;
     mutable DocDataType maDocs;
-    ScDocument* mpFakeDoc; // just to have something to pass to the methods that need to validate columns/rows
+    ScDocumentUniquePtr mxFakeDoc; // just to have something to pass to the methods that need to validate columns/rows
 };
 
 class SC_DLLPUBLIC ScExternalRefManager final : public formula::ExternalReferenceHelper, public SfxListener
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 56273f1b6c99..c164c548424e 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -457,7 +457,7 @@ ScExternalRefCache::CellFormat::CellFormat() :
 }
 
 ScExternalRefCache::ScExternalRefCache()
- : mpFakeDoc(new ScDocument())
+ : mxFakeDoc(new ScDocument())
 {}
 
 ScExternalRefCache::~ScExternalRefCache() {}
@@ -687,7 +687,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
 
             ScMatrixToken aToken(xMat);
             if (!pArray)
-                pArray.reset(new ScTokenArray(mpFakeDoc));
+                pArray.reset(new ScTokenArray(mxFakeDoc.get()));
             pArray->AddToken(aToken);
 
             bFirstTab = false;


More information about the Libreoffice-commits mailing list