diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-22 23:46:51 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-24 23:29:38 -0400 |
commit | 97a640d2a447e71f6d6947b47efe9a7f6a2ce4ce (patch) | |
tree | cf19cb1f3bc14667360f435aebcd0006869e5e64 | |
parent | 4ec43284e3a2f5ae43cc1cdef71f153560b0a1a8 (diff) |
Work on removing CalcRelFromAbs().
Change-Id: Ieb8b19821d778fa4596e680e73ba583667b5231a
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 19 | ||||
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 11 |
2 files changed, 12 insertions, 18 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index f778321f1059..c63921ff372c 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2697,7 +2697,7 @@ bool ScCompiler::IsDoubleReference( const String& rName ) if ( !(nFlags & SCA_VALID_TAB2) ) aRef.Ref2.SetTabDeleted( true ); // #REF! aRef.Ref2.SetFlag3D( ( nFlags & SCA_TAB2_3D ) != 0 ); - aRef.CalcRelFromAbs( aPos ); + aRef.SetRange(aRange, aPos); if (aExtInfo.mbExternal) { ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager(); @@ -2745,7 +2745,7 @@ bool ScCompiler::IsSingleReference( const String& rName ) aRef.nTab = MAXTAB+3; nFlags |= SCA_VALID; } - aRef.CalcRelFromAbs( aPos ); + aRef.SetAddress(aAddr, aPos); if (aExtInfo.mbExternal) { @@ -3040,14 +3040,11 @@ bool ScCompiler::IsColRowName( const String& rName ) if ( ScGlobal::GetpTransliteration()->isEqual( aStr, aName ) ) { aRef.InitFlags(); - aRef.nCol = aIter.GetPos().Col(); - aRef.nRow = aIter.GetPos().Row(); - aRef.nTab = aIter.GetPos().Tab(); if ( !jRow ) aRef.SetColRel( true ); // ColName else aRef.SetRowRel( true ); // RowName - aRef.CalcRelFromAbs( aPos ); + aRef.SetAddress(aIter.GetPos(), aPos); bInList = bFound = true; } } @@ -3225,14 +3222,14 @@ bool ScCompiler::IsColRowName( const String& rName ) else aAdr = aOne; aRef.InitAddress( aAdr ); - if ( (aRef.nRow != MAXROW && pDoc->HasStringData( - aRef.nCol, aRef.nRow + 1, aRef.nTab )) - || (aRef.nRow != 0 && pDoc->HasStringData( - aRef.nCol, aRef.nRow - 1, aRef.nTab )) ) + if ( (aAdr.Row() != MAXROW && pDoc->HasStringData( + aAdr.Col(), aAdr.Row() + 1, aAdr.Tab())) + || (aAdr.Row() != 0 && pDoc->HasStringData( + aAdr.Col(), aAdr.Row() - 1, aAdr.Tab()))) aRef.SetRowRel( true ); // RowName else aRef.SetColRel( true ); // ColName - aRef.CalcRelFromAbs( aPos ); + aRef.SetAddress(aAdr, aPos); } } if ( bFound ) diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index a06f0ff55bd6..84fae0971578 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3538,13 +3538,10 @@ void ScInterpreter::ScDBArea() { ScComplexRefData aRefData; aRefData.InitFlags(); - pDBData->GetArea( (SCTAB&) aRefData.Ref1.nTab, - (SCCOL&) aRefData.Ref1.nCol, - (SCROW&) aRefData.Ref1.nRow, - (SCCOL&) aRefData.Ref2.nCol, - (SCROW&) aRefData.Ref2.nRow); - aRefData.Ref2.nTab = aRefData.Ref1.nTab; - aRefData.CalcRelFromAbs( aPos ); + ScRange aRange; + pDBData->GetArea(aRange); + aRange.aEnd.SetTab(aRange.aStart.Tab()); + aRefData.SetRange(aRange, aPos); PushTempToken( new ScDoubleRefToken( aRefData ) ); } else |