From 8f68e19356bfbc20f52e70a2b88ce77e01304b30 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 7 Jun 2017 16:43:43 +0300 Subject: Take new FormulaTokenArrayPlainIterator into use in a couple more places Change-Id: Iaccbc7927943948136a56ba17f6bcff3a6971f31 --- sc/source/core/data/document10.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sc/source') diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index 2dc37a90c937..fddc029dc815 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -564,7 +564,8 @@ bool ScDocument::FindRangeNamesReferencingSheet( sc::UpdatedRangeNames& rIndexes bool bRef = !bSameDoc; // include every name used when copying to other doc if (nRecursion < 126) // whatever.. 42*3 { - for (const formula::FormulaToken* p = pCode->First(); p; p = pCode->Next()) + formula::FormulaTokenArrayPlainIterator aIter(*pCode); + for (const formula::FormulaToken* p = aIter.First(); p; p = aIter.Next()) { if (p->GetOpCode() == ocName) { @@ -603,7 +604,8 @@ MightReferenceSheet mightRangeNameReferenceSheet( ScRangeData* pData, SCTAB nRef if (!pCode) return MightReferenceSheet::NONE; - for (const formula::FormulaToken* p = pCode->First(); p; p = pCode->Next()) + formula::FormulaTokenArrayPlainIterator aIter(*pCode); + for (const formula::FormulaToken* p = aIter.First(); p; p = aIter.Next()) { if (p->GetOpCode() == ocName) return MightReferenceSheet::NAME; @@ -850,7 +852,8 @@ bool ScDocument::CopyAdjustRangeName( SCTAB& rSheet, sal_uInt16& rIndex, ScRange ScTokenArray* pCode = iRD->GetCode(); if (pCode) { - for (formula::FormulaToken* p = pCode->First(); p; p = pCode->Next()) + formula::FormulaTokenArrayPlainIterator aIter(*pCode); + for (formula::FormulaToken* p = aIter.First(); p; p = aIter.Next()) { if (p->GetOpCode() == ocName) { -- cgit