diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-06-27 13:52:50 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-06-27 15:50:07 -0400 |
commit | c8ed4d86bbdde79ea28c59742eac702f9622d57a (patch) | |
tree | 2aeb07d9a3a7bf8a69304f6324d40d085ab84fb8 /sc | |
parent | d14e48591f2ede07626bfa8adde403d762a28d18 (diff) |
Remove this old attempt of shared formula code.
We'll devise a brand-new solution for this.
Change-Id: Ib4e04b3ce0b5d1ab511aecfab35f81e43dd4edf9
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 56 |
2 files changed, 1 insertions, 56 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 81cd26d3b886..a3ab73dc31ba 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2055,7 +2055,6 @@ bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode, if ( pUndoCellPos ) aUndoPos = *pUndoCellPos; ScAddress aOldPos( aPos ); -// bool bPosChanged = false; // if this cell was moved bool bIsInsert = (eUpdateRefMode == URM_INSDEL && nDx >= 0 && nDy >= 0 && nDz >= 0); if (eUpdateRefMode == URM_INSDEL && r.In( aPos )) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index d0ef4addf033..ca8be5e5496c 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4267,14 +4267,6 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, } else { -/* - * Set SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE to 1 if we wanted to preserve as - * many shared formulas as possible instead of replacing them with direct code. - * Note that this may produce shared formula usage Excel doesn't understand, - * which would have to be adapted for in the export filter. Advisable as a long - * term goal, since it could decrease memory footprint. - */ -#define SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE 0 ScRangeData* pRangeData = NULL; ScToken* t; pArr->Reset(); @@ -4286,9 +4278,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, if (pName && pName->HasType(RT_SHAREDMOD)) { pRangeData = pName; // maybe need a replacement of shared with own code -#if ! SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE rChanged = true; -#endif } } else if( t->GetType() != svIndex ) // it may be a DB area!!! @@ -4335,24 +4325,11 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, } } } -#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - bool bEasyShared, bPosInRange; - if ( !pRangeData ) - bEasyShared = bPosInRange = false; - else - { - bEasyShared = true; - bPosInRange = r.In( eUpdateRefMode == URM_MOVE ? aPos : rOldPos ); - } -#endif pArr->Reset(); while ( (t = static_cast<ScToken*>(pArr->GetNextReferenceRPN())) != NULL ) { if ( t->GetRef() != 1 ) { -#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - bEasyShared = false; -#endif } else { // if nRefCnt>1 it's already updated in token code @@ -4374,15 +4351,6 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, ) rChanged = true; } -#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - if ( bEasyShared ) - { - const ScSingleRefData& rSRD = aMod.Ref().Ref1; - ScAddress aRef( rSRD.nCol, rSRD.nRow, rSRD.nTab ); - if ( r.In( aRef ) != bPosInRange ) - bEasyShared = false; - } -#endif } else { @@ -4408,35 +4376,13 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode, rRef.Ref2.nTab - rRef.Ref1.nTab != nTabs) { rRefSizeChanged = true; -#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - bEasyShared = false; -#endif } } } -#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - if ( bEasyShared ) - { - ScRange aRef( rRef.Ref1.nCol, rRef.Ref1.nRow, - rRef.Ref1.nTab, rRef.Ref2.nCol, rRef.Ref2.nRow, - rRef.Ref2.nTab ); - if ( r.In( aRef ) != bPosInRange ) - bEasyShared = false; - } -#endif } } } -#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE - if ( pRangeData ) - { - if ( bEasyShared ) - pRangeData = 0; - else - rChanged = true; - } -#endif -#undef SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE + return pRangeData; } } |