diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-04-14 11:23:23 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-04-14 11:41:05 -0400 |
commit | 8f403051968298fbabd61de82fbb6a77762c83cc (patch) | |
tree | ef984426aa1e825524a0936ceefbf154c01400f7 /sc | |
parent | 85a070f93f4dc02a1c0142e4e8f03bde55227e76 (diff) |
fdo#77209: Share string pool with clip documents.
We do the same with undo documents, and it will only make sense to do
the same with clip documents as well. Also, put the sharing part into
a common method (for ease of tracking).
Change-Id: I342b22d95374ee06d16318a66ffea0ac5b42621c
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen2.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/document10.cxx | 7 |
4 files changed, 12 insertions, 5 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 6fe5f9f128bf..582d086e68ee 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2147,6 +2147,8 @@ private: // CLOOK-Impl-methods SCSIZE GetPatternCount( SCTAB nTab, SCCOL nCol ) const; SCSIZE GetPatternCount( SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2 ) const; bool ReservePatternCount( SCTAB nTab, SCCOL nCol, SCSIZE nReserve ); + + void SharePooledResources( ScDocument* pSrcDoc ); }; inline void ScDocument::GetSortParam( ScSortParam& rParam, SCTAB nTab ) { diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 3390f8af0675..1ea05ca78768 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -464,7 +464,7 @@ void ScDocument::InitClipPtrs( ScDocument* pSourceDoc ) Clear(); - xPoolHelper = pSourceDoc->xPoolHelper; + SharePooledResources(pSourceDoc); // bedingte Formate / Gueltigkeiten //! Vorlagen kopieren? diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index b5f412b8a26b..4f90b2fdd503 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1831,8 +1831,7 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe { Clear(); - xPoolHelper = pSrcDoc->xPoolHelper; - + SharePooledResources(pSrcDoc); OUString aString; for (SCTAB nTab = 0; nTab <= rTabSelection.GetLastSelected(); nTab++) @@ -1867,8 +1866,7 @@ void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2, Clear(); // Undo document shares its pooled resources with the source document. - xPoolHelper = pSrcDoc->xPoolHelper; - mpCellStringPool = pSrcDoc->mpCellStringPool; + SharePooledResources(pSrcDoc); if (pSrcDoc->pShell->GetMedium()) maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI); diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index e4a2ff15b046..a04e8f9188e1 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -16,6 +16,7 @@ #include <editutil.hxx> #include <listenercontext.hxx> #include <tokenstringcontext.hxx> +#include <poolhelp.hxx> // Add totally brand-new methods to this source file. @@ -263,4 +264,10 @@ void ScDocument::PostprocessRangeNameUpdate() } } +void ScDocument::SharePooledResources( ScDocument* pSrcDoc ) +{ + xPoolHelper = pSrcDoc->xPoolHelper; + mpCellStringPool = pSrcDoc->mpCellStringPool; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |