From cc5f8c6bf09c88859a317f822800e569670873f8 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 27 Apr 2016 16:00:29 +0200 Subject: FindRangeNameByIndexAndSheet() to FindRangeNameBySheetAndIndex() index,sheet was slightly confusing as we lookup an index within a sheet. Change-Id: I164dd48187e6652639094e33ca83a91a96c893a0 --- sc/inc/document.hxx | 6 +++--- sc/source/core/data/conditio.cxx | 2 +- sc/source/core/data/documen3.cxx | 2 +- sc/source/core/data/formulacell.cxx | 12 ++++++------ sc/source/core/data/validat.cxx | 2 +- sc/source/core/tool/compiler.cxx | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 958ffc46f842..d04e8960ebb5 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -543,13 +543,13 @@ public: void SetRangeName( ScRangeName* pNewRangeName ); /** Find a named expression / range name in either global or a local scope. - @param nIndex - Index of named expression / range name. @param nTab If <0 search nIndex in global scope, if >=0 search nIndex in scope of nTab. + @param nIndex + Index of named expression / range name. @return nullptr if indexed name not found. */ - ScRangeData* FindRangeNameByIndexAndSheet( sal_uInt16 nIndex, SCTAB nTab ) const; + ScRangeData* FindRangeNameBySheetAndIndex( SCTAB nTab, sal_uInt16 nIndex ) const; /** * Call this immediately before updating all named ranges. diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index e1a42f887448..1e3373fcd907 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -107,7 +107,7 @@ static bool lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, sal_uInt16 case svIndex: { if( t->GetOpCode() == ocName ) // DB areas always absolute - if( ScRangeData* pRangeData = pDoc->FindRangeNameByIndexAndSheet( t->GetIndex(), t->GetSheet()) ) + if( ScRangeData* pRangeData = pDoc->FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex()) ) if( (nRecursion < 42) && lcl_HasRelRef( pDoc, pRangeData->GetCode(), nRecursion + 1 ) ) return true; } diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index c6ae38fb3ac1..9eac83d98fc8 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -244,7 +244,7 @@ const ScRangeData* ScDocument::GetRangeAtBlock( const ScRange& rBlock, OUString* return pData; } -ScRangeData* ScDocument::FindRangeNameByIndexAndSheet( sal_uInt16 nIndex, SCTAB nTab ) const +ScRangeData* ScDocument::FindRangeNameBySheetAndIndex( SCTAB nTab, sal_uInt16 nIndex ) const { const ScRangeName* pRN = (nTab < 0 ? GetRangeName() : GetRangeName(nTab)); return (pRN ? pRN->findByIndex( nIndex) : nullptr); diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index d3bb65eb37bd..a916816dde88 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -466,7 +466,7 @@ bool findRangeNamesReferencingSheet( sc::UpdatedRangeNames& rIndexes, const Form SAL_WARN("sc.core", "findRangeNamesReferencingSheet - nTokenTab < -1 : " << nTokenTab << ", nTokenIndex " << nTokenIndex << " Fix the creator!"); #if OSL_DEBUG_LEVEL > 0 - const ScRangeData* pData = pDoc->FindRangeNameByIndexAndSheet( nTokenIndex, nTokenTab); + const ScRangeData* pData = pDoc->FindRangeNameBySheetAndIndex( nTokenTab, nTokenIndex); SAL_WARN_IF( pData, "sc.core", "findRangeNamesReferencingSheet - named expression is: " << pData->GetName()); #endif nTokenTab = -1; @@ -485,7 +485,7 @@ bool findRangeNamesReferencingSheet( sc::UpdatedRangeNames& rIndexes, const Form if (rIndexes.isNameUpdated( nTokenTab, nTokenIndex)) return true; - ScRangeData* pData = pDoc->FindRangeNameByIndexAndSheet( nTokenIndex, nTokenTab); + ScRangeData* pData = pDoc->FindRangeNameBySheetAndIndex( nTokenTab, nTokenIndex); if (!pData) return false; @@ -1235,7 +1235,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons } else if ( t->GetType() == svIndex ) { - const ScRangeData* pRangeData = rDoc.FindRangeNameByIndexAndSheet( t->GetIndex(), t->GetSheet()); + const ScRangeData* pRangeData = rDoc.FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex()); if( pRangeData ) { if( pRangeData->HasReferences() ) @@ -3899,7 +3899,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD { if( t->GetOpCode() == ocName ) { - const ScRangeData* pName = pDocument->FindRangeNameByIndexAndSheet( t->GetIndex(), t->GetSheet()); + const ScRangeData* pName = pDocument->FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex()); if (pName) { if (pName->IsModified()) @@ -3953,7 +3953,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY { if( t->GetOpCode() == ocName ) { - const ScRangeData* pName = pDocument->FindRangeNameByIndexAndSheet( t->GetIndex(), t->GetSheet()); + const ScRangeData* pName = pDocument->FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex()); if (pName) { if (pName->IsModified()) @@ -3998,7 +3998,7 @@ static void lcl_FindRangeNamesInUse(sc::UpdatedRangeNames& rIndexes, ScTokenArra if (nRecursion < 126) // whatever.. 42*3 { - ScRangeData* pSubName = pDoc->FindRangeNameByIndexAndSheet( nTokenIndex, nTab); + ScRangeData* pSubName = pDoc->FindRangeNameBySheetAndIndex( nTab, nTokenIndex); if (pSubName) lcl_FindRangeNamesInUse(rIndexes, pSubName->GetCode(), pDoc, nRecursion+1); } diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 803140daf380..1f4583e47ffb 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -694,7 +694,7 @@ bool ScValidationData::GetSelectionFromFormula( } else if (eOpCode == ocName) { - const ScRangeData* pName = pDocument->FindRangeNameByIndexAndSheet( t->GetIndex(), t->GetSheet()); + const ScRangeData* pName = pDocument->FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex()); if (pName && pName->IsReference(aRange)) { bRef = true; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index e760997d63c4..958f5b3676dc 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4435,7 +4435,7 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula, const OUStrin ScRangeData* ScCompiler::GetRangeData( const FormulaToken& rToken ) const { - return pDoc->FindRangeNameByIndexAndSheet( rToken.GetIndex(), rToken.GetSheet()); + return pDoc->FindRangeNameBySheetAndIndex( rToken.GetSheet(), rToken.GetIndex()); } bool ScCompiler::HandleRange() -- cgit