summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx22
-rw-r--r--include/formula/FormulaCompiler.hxx14
-rw-r--r--sc/inc/compiler.hxx10
-rw-r--r--sc/source/core/tool/compiler.cxx13
4 files changed, 30 insertions, 29 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 78861b85f65e..64121e6d6b52 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1762,7 +1762,7 @@ void FormulaCompiler::CreateStringFromTokenArray( OUStringBuffer& rBuffer )
if ( pArr->IsRecalcModeForced() )
rBuffer.append( '=');
- FormulaToken* t = pArr->First();
+ const FormulaToken* t = pArr->First();
while( t )
t = CreateStringFromToken( rBuffer, t, true );
@@ -1773,19 +1773,21 @@ void FormulaCompiler::CreateStringFromTokenArray( OUStringBuffer& rBuffer )
}
}
-FormulaToken* FormulaCompiler::CreateStringFromToken( OUString& rFormula, FormulaToken* pTokenP,bool bAllowArrAdvance )
+const FormulaToken* FormulaCompiler::CreateStringFromToken( OUString& rFormula, const FormulaToken* pTokenP,
+ bool bAllowArrAdvance )
{
OUStringBuffer aBuffer;
- FormulaToken* p = CreateStringFromToken( aBuffer, pTokenP, bAllowArrAdvance );
+ const FormulaToken* p = CreateStringFromToken( aBuffer, pTokenP, bAllowArrAdvance );
rFormula += aBuffer.makeStringAndClear();
return p;
}
-FormulaToken* FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuffer, FormulaToken* pTokenP, bool bAllowArrAdvance )
+const FormulaToken* FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuffer, const FormulaToken* pTokenP,
+ bool bAllowArrAdvance )
{
bool bNext = true;
bool bSpaces = false;
- FormulaToken* t = pTokenP;
+ const FormulaToken* t = pTokenP;
OpCode eOp = t->GetOpCode();
if( eOp >= ocAnd && eOp <= ocOr )
{
@@ -2116,23 +2118,23 @@ bool FormulaCompiler::HandleTableRef()
return true;
}
-void FormulaCompiler::CreateStringFromSingleRef( OUStringBuffer& /*rBuffer*/, FormulaToken* /*pTokenP*/) const
+void FormulaCompiler::CreateStringFromSingleRef( OUStringBuffer& /*rBuffer*/, const FormulaToken* /*pToken*/) const
{
}
-void FormulaCompiler::CreateStringFromDoubleRef( OUStringBuffer& /*rBuffer*/, FormulaToken* /*pTokenP*/) const
+void FormulaCompiler::CreateStringFromDoubleRef( OUStringBuffer& /*rBuffer*/, const FormulaToken* /*pToken*/) const
{
}
-void FormulaCompiler::CreateStringFromIndex( OUStringBuffer& /*rBuffer*/, FormulaToken* /*pTokenP*/) const
+void FormulaCompiler::CreateStringFromIndex( OUStringBuffer& /*rBuffer*/, const FormulaToken* /*pToken*/) const
{
}
-void FormulaCompiler::CreateStringFromMatrix( OUStringBuffer& /*rBuffer*/, FormulaToken* /*pTokenP*/) const
+void FormulaCompiler::CreateStringFromMatrix( OUStringBuffer& /*rBuffer*/, const FormulaToken* /*pToken*/) const
{
}
-void FormulaCompiler::CreateStringFromExternal( OUStringBuffer& /*rBuffer*/, FormulaToken* /*pTokenP*/) const
+void FormulaCompiler::CreateStringFromExternal( OUStringBuffer& /*rBuffer*/, const FormulaToken* /*pToken*/) const
{
}
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx
index 74d618fa8ee6..4137e62e90ac 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -242,9 +242,9 @@ public:
void CreateStringFromTokenArray( OUString& rFormula );
void CreateStringFromTokenArray( OUStringBuffer& rBuffer );
- FormulaToken* CreateStringFromToken( OUString& rFormula, FormulaToken* pToken,
+ const FormulaToken* CreateStringFromToken( OUString& rFormula, const FormulaToken* pToken,
bool bAllowArrAdvance = false );
- FormulaToken* CreateStringFromToken( OUStringBuffer& rBuffer, FormulaToken* pToken,
+ const FormulaToken* CreateStringFromToken( OUStringBuffer& rBuffer, const FormulaToken* pToken,
bool bAllowArrAdvance = false );
void AppendBoolean( OUStringBuffer& rBuffer, bool bVal ) const;
@@ -285,11 +285,11 @@ protected:
virtual bool HandleDbData();
virtual bool HandleTableRef();
- virtual void CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* pTokenP) const;
- virtual void CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken* pTokenP) const;
- virtual void CreateStringFromDoubleRef(OUStringBuffer& rBuffer,FormulaToken* pTokenP) const;
- virtual void CreateStringFromMatrix(OUStringBuffer& rBuffer,FormulaToken* pTokenP) const;
- virtual void CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* pTokenP) const;
+ virtual void CreateStringFromExternal( OUStringBuffer& rBuffer, const FormulaToken* pToken ) const;
+ virtual void CreateStringFromSingleRef( OUStringBuffer& rBuffer, const FormulaToken* pToken ) const;
+ virtual void CreateStringFromDoubleRef( OUStringBuffer& rBuffer, const FormulaToken* pToken ) const;
+ virtual void CreateStringFromMatrix( OUStringBuffer& rBuffer, const FormulaToken* pToken ) const;
+ virtual void CreateStringFromIndex( OUStringBuffer& rBuffer, const FormulaToken* pToken ) const;
virtual void LocalizeString( OUString& rName ) const; // modify rName - input: exact name
void AppendErrorConstant( OUStringBuffer& rBuffer, sal_uInt16 nError ) const;
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 03baa2983504..b0d9c71ae8a2 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -475,11 +475,11 @@ private:
virtual bool HandleTableRef() SAL_OVERRIDE;
virtual formula::FormulaTokenRef ExtendRangeReference( formula::FormulaToken & rTok1, formula::FormulaToken & rTok2, bool bReuseDoubleRef ) SAL_OVERRIDE;
- virtual void CreateStringFromExternal(OUStringBuffer& rBuffer, formula::FormulaToken* pTokenP) const SAL_OVERRIDE;
- virtual void CreateStringFromSingleRef(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP) const SAL_OVERRIDE;
- virtual void CreateStringFromDoubleRef(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP) const SAL_OVERRIDE;
- virtual void CreateStringFromMatrix( OUStringBuffer& rBuffer, formula::FormulaToken* _pTokenP) const SAL_OVERRIDE;
- virtual void CreateStringFromIndex(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP) const SAL_OVERRIDE;
+ virtual void CreateStringFromExternal( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const SAL_OVERRIDE;
+ virtual void CreateStringFromSingleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const SAL_OVERRIDE;
+ virtual void CreateStringFromDoubleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const SAL_OVERRIDE;
+ virtual void CreateStringFromMatrix( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const SAL_OVERRIDE;
+ virtual void CreateStringFromIndex( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const SAL_OVERRIDE;
virtual void LocalizeString( OUString& rName ) const SAL_OVERRIDE; // modify rName - input: exact name
/// Access the CharTable flags
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index c19b29f8c776..2e1ee10645c3 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4393,9 +4393,9 @@ bool ScCompiler::IsCharFlagAllConventions(
return false;
}
-void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* pTokenP) const
+void ScCompiler::CreateStringFromExternal( OUStringBuffer& rBuffer, const FormulaToken* pTokenP ) const
{
- FormulaToken* t = pTokenP;
+ const FormulaToken* t = pTokenP;
sal_uInt16 nFileId = t->GetIndex();
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
const OUString* pFileName = pRefMgr->getExternalFileName(nFileId);
@@ -4434,8 +4434,7 @@ void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken*
}
}
-void ScCompiler::CreateStringFromMatrix(
- OUStringBuffer& rBuffer, FormulaToken* pTokenP) const
+void ScCompiler::CreateStringFromMatrix( OUStringBuffer& rBuffer, const FormulaToken* pTokenP ) const
{
const ScMatrix* pMatrix = pTokenP->GetMatrix();
SCSIZE nC, nMaxC, nR, nMaxR;
@@ -4479,7 +4478,7 @@ void ScCompiler::CreateStringFromMatrix(
rBuffer.append( mxSymbols->getSymbol(ocArrayClose) );
}
-void ScCompiler::CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken* _pTokenP) const
+void ScCompiler::CreateStringFromSingleRef( OUStringBuffer& rBuffer, const FormulaToken* _pTokenP ) const
{
OUString aErrRef = GetCurrentOpCodeMap()->getSymbol(ocErrRef);
const OpCode eOp = _pTokenP->GetOpCode();
@@ -4507,14 +4506,14 @@ void ScCompiler::CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken*
GetSetupTabNames(), aRef, true);
}
-void ScCompiler::CreateStringFromDoubleRef(OUStringBuffer& rBuffer,FormulaToken* _pTokenP) const
+void ScCompiler::CreateStringFromDoubleRef( OUStringBuffer& rBuffer, const FormulaToken* _pTokenP ) const
{
OUString aErrRef = GetCurrentOpCodeMap()->getSymbol(ocErrRef);
pConv->makeRefStr(rBuffer, meGrammar, aPos, aErrRef, GetSetupTabNames(),
*_pTokenP->GetDoubleRef(), false);
}
-void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pTokenP) const
+void ScCompiler::CreateStringFromIndex( OUStringBuffer& rBuffer, const FormulaToken* _pTokenP ) const
{
const OpCode eOp = _pTokenP->GetOpCode();
OUStringBuffer aBuffer;