diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-04-14 11:23:23 -0400 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-04-14 17:08:46 +0000 |
commit | bb1bea8e01f899e43da4372fc4121e387d60102c (patch) | |
tree | f01752ef5af15c93e5bdc264da48e824ad8919ee | |
parent | f2aa4f23a75b48bb8e0d0c3fefa4de5634677e75 (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).
(cherry picked from commit 8f403051968298fbabd61de82fbb6a77762c83cc)
Conflicts:
sc/inc/document.hxx
Change-Id: I342b22d95374ee06d16318a66ffea0ac5b42621c
Reviewed-on: https://gerrit.libreoffice.org/9005
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/inc/document.hxx | 1 | ||||
-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, 11 insertions, 5 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index b4e86f3e93b6..8c8cbf113f19 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2123,6 +2123,7 @@ private: // CLOOK-Impl-methods std::map< SCTAB, ScSortParam > mSheetSortParams; + 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 daa4e2ae9bb7..eb3eab2cc3a7 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -478,7 +478,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 90128ef50620..bc6673575b09 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 ba95499f0d56..823f9929da9f 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. @@ -67,4 +68,10 @@ void ScDocument::PostprocessRangeNameUpdate() } } +void ScDocument::SharePooledResources( ScDocument* pSrcDoc ) +{ + xPoolHelper = pSrcDoc->xPoolHelper; + mpCellStringPool = pSrcDoc->mpCellStringPool; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |