summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-06-16 17:08:17 +0300
committerTor Lillqvist <tml@collabora.com>2017-06-19 12:23:23 +0300
commitcfd5d203e9c641c150f92c2b1ee5b84e89e6dc99 (patch)
treeb04b5d388665647a1309f97f10ba1d591c6715af /formula
parent896dbaee45ca0dd2d4127a4b27455e8e8509d9c7 (diff)
Drop another friend declaration
Change-Id: I06dd3639e4110700e070f1224112a9fa6597a832
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx10
-rw-r--r--formula/source/core/api/token.cxx72
2 files changed, 41 insertions, 41 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 1ba70a90f81d..24b7d15d723b 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1300,7 +1300,7 @@ bool FormulaCompiler::GetToken()
if ( nWasColRowName >= 2 && mpToken->GetOpCode() == ocColRowName )
{ // convert an ocSpaces to ocIntersect in RPN
mpLastToken = mpToken = new FormulaByteToken( ocIntersect );
- maArrIterator.mnIndex--; // we advanced to the second ocColRowName, step back
+ maArrIterator.StepBack(); // we advanced to the second ocColRowName, step back
}
else if (pSpacesToken && FormulaGrammar::isExcelSyntax( meGrammar) &&
mpLastToken && mpToken &&
@@ -1310,7 +1310,7 @@ bool FormulaCompiler::GetToken()
// Let IntersectionLine() <- Factor() decide how to treat this,
// once the actual arguments are determined in RPN.
mpLastToken = mpToken = pSpacesToken;
- maArrIterator.mnIndex--; // step back from next non-spaces token
+ maArrIterator.StepBack(); // step back from next non-spaces token
return true;
}
}
@@ -1498,7 +1498,7 @@ void FormulaCompiler::Factor()
else
SetError( FormulaError::PairExpected);
sal_uInt8 nSepCount = 0;
- const sal_uInt16 nSepPos = maArrIterator.mnIndex - 1; // separator position, if any
+ const sal_uInt16 nSepPos = maArrIterator.GetIndex() - 1; // separator position, if any
if( !bNoParam )
{
nSepCount++;
@@ -1525,7 +1525,7 @@ void FormulaCompiler::Factor()
// Current index is nSepPos+3 if expression stops, or
// nSepPos+4 if expression continues after the call because
// we just called NextToken() to move away from it.
- if (pc >= 2 && (maArrIterator.mnIndex == nSepPos + 3 || maArrIterator.mnIndex == nSepPos + 4) &&
+ if (pc >= 2 && (maArrIterator.GetIndex() == nSepPos + 3 || maArrIterator.GetIndex() == nSepPos + 4) &&
pArr->TokenAt(nSepPos+1)->GetType() == svDouble &&
pArr->TokenAt(nSepPos+1)->GetDouble() != 1.0 &&
pArr->TokenAt(nSepPos+2)->GetOpCode() == ocClose &&
@@ -1788,7 +1788,7 @@ void FormulaCompiler::IntersectionLine()
RangeLine();
while (mpToken->GetOpCode() == ocIntersect || mpToken->GetOpCode() == ocSpaces)
{
- sal_uInt16 nCodeIndex = maArrIterator.mnIndex - 1;
+ sal_uInt16 nCodeIndex = maArrIterator.GetIndex() - 1;
FormulaToken** pCode1 = pCode - 1;
FormulaTokenRef p = mpToken;
NextToken();
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 51f3e0fa928d..2cd4b63f92a4 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1536,15 +1536,15 @@ void FormulaTokenIterator::Reset()
FormulaToken* FormulaTokenArrayPlainIterator::GetNextName()
{
- if( mpFTA->pCode )
+ if( mpFTA->GetArray() )
{
- while ( mnIndex < mpFTA->nLen )
+ while ( mnIndex < mpFTA->GetLen() )
{
- FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
+ FormulaToken* t = mpFTA->GetArray()[ mnIndex++ ];
if( t->GetType() == svIndex )
return t;
}
- } // if( pCode )
+ }
return nullptr;
}
@@ -1595,9 +1595,9 @@ const FormulaToken* FormulaTokenIterator::GetNonEndOfPathToken( short nIdx ) con
{
FormulaTokenIterator::Item cur = maStack.back();
- if (nIdx < cur.pArr->nRPN && nIdx < cur.nStop)
+ if (nIdx < cur.pArr->GetCodeLen() && nIdx < cur.nStop)
{
- const FormulaToken* t = cur.pArr->pRPN[ nIdx ];
+ const FormulaToken* t = cur.pArr->GetCode()[ nIdx ];
// such an OpCode ends an IF() or CHOOSE() path
return (t->GetOpCode() == ocSep || t->GetOpCode() == ocClose) ? nullptr : t;
}
@@ -1611,9 +1611,9 @@ bool FormulaTokenIterator::IsEndOfPath() const
FormulaToken* FormulaTokenArrayPlainIterator::GetNextReference()
{
- while( mnIndex < mpFTA->nLen )
+ while( mnIndex < mpFTA->GetLen() )
{
- FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
+ FormulaToken* t = mpFTA->GetArray()[ mnIndex++ ];
switch( t->GetType() )
{
case svSingleRef:
@@ -1632,9 +1632,9 @@ FormulaToken* FormulaTokenArrayPlainIterator::GetNextReference()
FormulaToken* FormulaTokenArrayPlainIterator::GetNextColRowName()
{
- while( mnIndex < mpFTA->nLen )
+ while( mnIndex < mpFTA->GetLen() )
{
- FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
+ FormulaToken* t = mpFTA->GetArray()[ mnIndex++ ];
if ( t->GetOpCode() == ocColRowName )
return t;
}
@@ -1643,9 +1643,9 @@ FormulaToken* FormulaTokenArrayPlainIterator::GetNextColRowName()
FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceRPN()
{
- while( mnIndex < mpFTA->nRPN )
+ while( mnIndex < mpFTA->GetCodeLen() )
{
- FormulaToken* t = mpFTA->pRPN[ mnIndex++ ];
+ FormulaToken* t = mpFTA->GetCode()[ mnIndex++ ];
switch( t->GetType() )
{
case svSingleRef:
@@ -1664,11 +1664,11 @@ FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceRPN()
FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceOrName()
{
- if( mpFTA->pCode )
+ if( mpFTA->GetArray() )
{
- while ( mnIndex < mpFTA->nLen )
+ while ( mnIndex < mpFTA->GetLen() )
{
- FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
+ FormulaToken* t = mpFTA->GetArray()[ mnIndex++ ];
switch( t->GetType() )
{
case svSingleRef:
@@ -1690,57 +1690,57 @@ FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceOrName()
FormulaToken* FormulaTokenArrayPlainIterator::Next()
{
- if( mpFTA->pCode && mnIndex < mpFTA->nLen )
- return mpFTA->pCode[ mnIndex++ ];
+ if( mpFTA->GetArray() && mnIndex < mpFTA->GetLen() )
+ return mpFTA->GetArray()[ mnIndex++ ];
else
return nullptr;
}
FormulaToken* FormulaTokenArrayPlainIterator::NextNoSpaces()
{
- if( mpFTA->pCode )
+ if( mpFTA->GetArray() )
{
- while( (mnIndex < mpFTA->nLen) && (mpFTA->pCode[ mnIndex ]->GetOpCode() == ocSpaces) )
+ while( (mnIndex < mpFTA->GetLen()) && (mpFTA->GetArray()[ mnIndex ]->GetOpCode() == ocSpaces) )
++mnIndex;
- if( mnIndex < mpFTA->nLen )
- return mpFTA->pCode[ mnIndex++ ];
+ if( mnIndex < mpFTA->GetLen() )
+ return mpFTA->GetArray()[ mnIndex++ ];
}
return nullptr;
}
FormulaToken* FormulaTokenArrayPlainIterator::NextRPN()
{
- if( mpFTA->pRPN && mnIndex < mpFTA->nRPN )
- return mpFTA->pRPN[ mnIndex++ ];
+ if( mpFTA->GetCode() && mnIndex < mpFTA->GetCodeLen() )
+ return mpFTA->GetCode()[ mnIndex++ ];
else
return nullptr;
}
FormulaToken* FormulaTokenArrayPlainIterator::PrevRPN()
{
- if( mpFTA->pRPN && mnIndex )
- return mpFTA->pRPN[ --mnIndex ];
+ if( mpFTA->GetCode() && mnIndex )
+ return mpFTA->GetCode()[ --mnIndex ];
else
return nullptr;
}
FormulaToken* FormulaTokenArrayPlainIterator::PeekNext()
{
- if( mpFTA->pCode && mnIndex < mpFTA->nLen )
- return mpFTA->pCode[ mnIndex ];
+ if( mpFTA->GetArray() && mnIndex < mpFTA->GetLen() )
+ return mpFTA->GetArray()[ mnIndex ];
else
return nullptr;
}
FormulaToken* FormulaTokenArrayPlainIterator::PeekNextNoSpaces() const
{
- if( mpFTA->pCode && mnIndex < mpFTA->nLen )
+ if( mpFTA->GetArray() && mnIndex < mpFTA->GetLen() )
{
sal_uInt16 j = mnIndex;
- while ( j < mpFTA->nLen && mpFTA->pCode[j]->GetOpCode() == ocSpaces )
+ while ( j < mpFTA->GetLen() && mpFTA->GetArray()[j]->GetOpCode() == ocSpaces )
j++;
- if ( j < mpFTA->nLen )
- return mpFTA->pCode[ j ];
+ if ( j < mpFTA->GetLen() )
+ return mpFTA->GetArray()[ j ];
else
return nullptr;
}
@@ -1750,13 +1750,13 @@ FormulaToken* FormulaTokenArrayPlainIterator::PeekNextNoSpaces() const
FormulaToken* FormulaTokenArrayPlainIterator::PeekPrevNoSpaces() const
{
- if( mpFTA->pCode && mnIndex > 1 )
+ if( mpFTA->GetArray() && mnIndex > 1 )
{
sal_uInt16 j = mnIndex - 2;
- while ( mpFTA->pCode[j]->GetOpCode() == ocSpaces && j > 0 )
+ while ( mpFTA->GetArray()[j]->GetOpCode() == ocSpaces && j > 0 )
j--;
- if ( j > 0 || mpFTA->pCode[j]->GetOpCode() != ocSpaces )
- return mpFTA->pCode[ j ];
+ if ( j > 0 || mpFTA->GetArray()[j]->GetOpCode() != ocSpaces )
+ return mpFTA->GetArray()[ j ];
else
return nullptr;
}
@@ -1766,7 +1766,7 @@ FormulaToken* FormulaTokenArrayPlainIterator::PeekPrevNoSpaces() const
void FormulaTokenArrayPlainIterator::AfterRemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount )
{
- const sal_uInt16 nStop = std::min( static_cast<sal_uInt16>(nOffset + nCount), mpFTA->nLen);
+ const sal_uInt16 nStop = std::min( static_cast<sal_uInt16>(nOffset + nCount), mpFTA->GetLen());
if (mnIndex >= nOffset)
{