diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-28 10:37:28 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-28 10:43:00 -0400 |
commit | a25c18677cea656ac52b5c08508ac70b107588bc (patch) | |
tree | 6a5457ce1ecb1a2ec30ae62f670be39b9971c238 /sc/source/core/data/document.cxx | |
parent | 7c8625b0dc7fd961404125441e33c33b1123fe4f (diff) |
Cache column data arrays to avoid duplicating data arrays.
Each array's start position is always row 0, to keep the array element
indices in sync with row positions.
Change-Id: I4781fd8c24111bd991216293ad362eef283767bd
Diffstat (limited to 'sc/source/core/data/document.cxx')
-rw-r--r-- | sc/source/core/data/document.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 15e7ee5bd03d..f8a6d922c640 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -94,6 +94,7 @@ #include "listenercontext.hxx" #include "scopetools.hxx" #include "refupdatecontext.hxx" +#include "formulagroup.hxx" #include "formula/vectortoken.hxx" @@ -1675,14 +1676,13 @@ formula::FormulaTokenRef ScDocument::ResolveStaticReference( const ScRange& rRan rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row()); } -formula::VectorRefArray ScDocument::FetchVectorRefArray( - sc::FormulaGroupContext& rCxt, const ScAddress& rPos, SCROW nLength ) +formula::VectorRefArray ScDocument::FetchVectorRefArray( const ScAddress& rPos, SCROW nLength ) { SCTAB nTab = rPos.Tab(); if (!TableExists(nTab)) return formula::VectorRefArray(); - return maTabs[nTab]->FetchVectorRefArray(rCxt, rPos.Col(), rPos.Row(), rPos.Row()+nLength-1); + return maTabs[nTab]->FetchVectorRefArray(rPos.Col(), rPos.Row(), rPos.Row()+nLength-1); } bool ScDocument::CanFitBlock( const ScRange& rOld, const ScRange& rNew ) @@ -3223,6 +3223,14 @@ svl::SharedString ScDocument::GetSharedString( const ScAddress& rPos ) const return maTabs[rPos.Tab()]->GetSharedString(rPos.Col(), rPos.Row()); } +sc::FormulaGroupContext& ScDocument::GetFormulaGroupContext() +{ + if (!mpFormulaGroupCxt) + mpFormulaGroupCxt.reset(new sc::FormulaGroupContext); + + return *mpFormulaGroupCxt; +} + void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rString ) { if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] ) @@ -3603,6 +3611,7 @@ void ScDocument::CalcAll() if (*it) (*it)->CalcAll(); ClearFormulaTree(); + mpFormulaGroupCxt.reset(); } |