summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-04 14:41:25 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-04 18:36:49 +0100
commit06de11f1d419f04a827bc6d6bc323f1c87ad83a5 (patch)
treed2de1e7c2185693d8b95569a92e962117ada4b77
parent6fbfb54086c10f0107dc7026eaeffd177eda56c3 (diff)
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@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/inc/externalrefmgr.hxx6
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx4
2 files changed, 5 insertions, 5 deletions
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;