summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-11-14 14:39:56 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-11-14 23:53:51 -0500
commitd9a914fe5b221f879c6fb7873c7e7011dc655421 (patch)
treeb3c5a683480e054bd600511df111a11cc35832ee /sc
parent6a4b377c1a5794efee4cbdc93289bc9ce5ead730 (diff)
Identify methods that don't modify internal state and mark them const.
Change-Id: Ie63d93d51640bfb80dc02bb226d742c2f9be96d8
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/compiler.hxx12
-rw-r--r--sc/source/core/tool/compiler.cxx20
2 files changed, 16 insertions, 16 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 3b366c04d6b7..4cd31a3ab6b0 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -472,12 +472,12 @@ private:
virtual bool HandleDbData();
virtual formula::FormulaTokenRef ExtendRangeReference( formula::FormulaToken & rTok1, formula::FormulaToken & rTok2, bool bReuseDoubleRef );
- virtual void CreateStringFromExternal(OUStringBuffer& rBuffer, formula::FormulaToken* pTokenP);
- virtual void CreateStringFromSingleRef(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP);
- virtual void CreateStringFromDoubleRef(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP);
- virtual void CreateStringFromMatrix( OUStringBuffer& rBuffer, formula::FormulaToken* _pTokenP);
- virtual void CreateStringFromIndex(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP);
- virtual void LocalizeString( OUString& rName ); // modify rName - input: exact name
+ virtual void CreateStringFromExternal(OUStringBuffer& rBuffer, formula::FormulaToken* pTokenP) const;
+ virtual void CreateStringFromSingleRef(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP) const;
+ virtual void CreateStringFromDoubleRef(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP) const;
+ virtual void CreateStringFromMatrix( OUStringBuffer& rBuffer, formula::FormulaToken* _pTokenP) const;
+ virtual void CreateStringFromIndex(OUStringBuffer& rBuffer,formula::FormulaToken* _pTokenP) const;
+ virtual void LocalizeString( OUString& rName ) const; // modify rName - input: exact name
/// Access the CharTable flags
inline sal_uLong GetCharTableFlags( sal_Unicode c, sal_Unicode cLast )
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index b297f66ac096..664145199586 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4122,7 +4122,7 @@ bool ScCompiler::IsCharFlagAllConventions(
return false;
}
-void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* pTokenP)
+void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* pTokenP) const
{
FormulaToken* t = pTokenP;
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
@@ -4150,8 +4150,8 @@ void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken*
}
}
-void ScCompiler::CreateStringFromMatrix( OUStringBuffer& rBuffer,
- FormulaToken* pTokenP)
+void ScCompiler::CreateStringFromMatrix(
+ OUStringBuffer& rBuffer, FormulaToken* pTokenP) const
{
const ScMatrix* pMatrix = static_cast<ScToken*>(pTokenP)->GetMatrix();
SCSIZE nC, nMaxC, nR, nMaxR;
@@ -4195,10 +4195,10 @@ void ScCompiler::CreateStringFromMatrix( OUStringBuffer& rBuffer,
rBuffer.append( mxSymbols->getSymbol(ocArrayClose) );
}
-void ScCompiler::CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken* _pTokenP)
+void ScCompiler::CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken* _pTokenP) const
{
const OpCode eOp = _pTokenP->GetOpCode();
- ScSingleRefData& rRef = static_cast<ScToken*>(_pTokenP)->GetSingleRef();
+ const ScSingleRefData& rRef = static_cast<const ScToken*>(_pTokenP)->GetSingleRef();
ScComplexRefData aRef;
aRef.Ref1 = aRef.Ref2 = rRef;
if ( eOp == ocColRowName )
@@ -4220,12 +4220,12 @@ void ScCompiler::CreateStringFromSingleRef(OUStringBuffer& rBuffer,FormulaToken*
pConv->MakeRefStr( rBuffer, *this, aRef, true );
}
-void ScCompiler::CreateStringFromDoubleRef(OUStringBuffer& rBuffer,FormulaToken* _pTokenP)
+void ScCompiler::CreateStringFromDoubleRef(OUStringBuffer& rBuffer,FormulaToken* _pTokenP) const
{
pConv->MakeRefStr( rBuffer, *this, static_cast<ScToken*>(_pTokenP)->GetDoubleRef(), false );
}
-void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pTokenP)
+void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pTokenP) const
{
const OpCode eOp = _pTokenP->GetOpCode();
OUStringBuffer aBuffer;
@@ -4233,14 +4233,14 @@ void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pT
{
case ocName:
{
- ScRangeData* pData = GetRangeData( *_pTokenP);
+ const ScRangeData* pData = GetRangeData( *_pTokenP);
if (pData)
aBuffer.append(pData->GetName());
}
break;
case ocDBArea:
{
- ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByIndex(_pTokenP->GetIndex());
+ const ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByIndex(_pTokenP->GetIndex());
if (pDBData)
aBuffer.append(pDBData->GetName());
}
@@ -4254,7 +4254,7 @@ void ScCompiler::CreateStringFromIndex(OUStringBuffer& rBuffer,FormulaToken* _pT
rBuffer.append(ScGlobal::GetRscString(STR_NO_NAME_REF));
}
-void ScCompiler::LocalizeString( OUString& rName )
+void ScCompiler::LocalizeString( OUString& rName ) const
{
ScGlobal::GetAddInCollection()->LocalizeString( rName );
}