diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-15 21:52:43 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-18 17:25:40 -0500 |
commit | ccc32f4c4f226318912d597ff3e8bbafbaec7576 (patch) | |
tree | 5060dde543b1d4d06df2b5af10019ae700ded98d | |
parent | 066d33c7bdcaa938ba7832e53944e1e1a73576cc (diff) |
Try not to pass ScCompiler as a parameter.
Change-Id: I7ef58f0455f11a3eb2ac88ec76e9436fb48a74e2
-rw-r--r-- | sc/inc/compiler.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 48 |
2 files changed, 26 insertions, 26 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index c780cca49969..b6251f7bff29 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -252,11 +252,11 @@ public: virtual OUString makeExternalNameStr( const OUString& rFile, const OUString& rName ) const = 0; - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef, ScExternalRefManager* pRefMgr ) const = 0; - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef, ScExternalRefManager* pRefMgr ) const = 0; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index dee954b93b21..d3e696e87f89 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -857,7 +857,7 @@ struct ConventionOOO_A1 : public Convention_A1 return true; } - void makeExternalRefStrImpl( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + void makeExternalRefStrImpl( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef, ScExternalRefManager* pRefMgr, bool bODF ) const { @@ -865,23 +865,23 @@ struct ConventionOOO_A1 : public Convention_A1 rBuffer.append( '['); bool bEncodeUrl = bODF; - makeExternalSingleRefStr(rBuffer, nFileId, rTabName, rRef, rCompiler.GetPos(), pRefMgr, true, bEncodeUrl); + makeExternalSingleRefStr(rBuffer, nFileId, rTabName, rRef, rPos, pRefMgr, true, bEncodeUrl); if (bODF) rBuffer.append( ']'); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef, ScExternalRefManager* pRefMgr ) const { - makeExternalRefStrImpl( rBuffer, rCompiler, nFileId, rTabName, rRef, pRefMgr, false); + makeExternalRefStrImpl(rBuffer, rPos, nFileId, rTabName, rRef, pRefMgr, false); } - void makeExternalRefStrImpl( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + void makeExternalRefStrImpl( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef, ScExternalRefManager* pRefMgr, bool bODF ) const { - ScRange aAbsRange = rRef.toAbs(rCompiler.GetPos()); + ScRange aAbsRange = rRef.toAbs(rPos); if (bODF) rBuffer.append( '['); @@ -890,7 +890,7 @@ struct ConventionOOO_A1 : public Convention_A1 do { - if (!makeExternalSingleRefStr(rBuffer, nFileId, rTabName, rRef.Ref1, rCompiler.GetPos(), pRefMgr, true, bEncodeUrl)) + if (!makeExternalSingleRefStr(rBuffer, nFileId, rTabName, rRef.Ref1, rPos, pRefMgr, true, bEncodeUrl)) break; rBuffer.append(':'); @@ -916,17 +916,17 @@ struct ConventionOOO_A1 : public Convention_A1 else if (bODF) rBuffer.append( '.'); // need at least the sheet separator in ODF makeExternalSingleRefStr( rBuffer, nFileId, aLastTabName, - rRef.Ref2, rCompiler.GetPos(), pRefMgr, bDisplayTabName, bEncodeUrl); + rRef.Ref2, rPos, pRefMgr, bDisplayTabName, bEncodeUrl); } while (0); if (bODF) rBuffer.append( ']'); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef, ScExternalRefManager* pRefMgr ) const { - makeExternalRefStrImpl( rBuffer, rCompiler, nFileId, rTabName, rRef, pRefMgr, false); + makeExternalRefStrImpl(rBuffer, rPos, nFileId, rTabName, rRef, pRefMgr, false); } }; @@ -975,18 +975,18 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1 return lcl_makeExternalNameStr( rFile, rName, '#', true); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef, ScExternalRefManager* pRefMgr ) const { - makeExternalRefStrImpl( rBuffer, rCompiler, nFileId, rTabName, rRef, pRefMgr, true); + makeExternalRefStrImpl(rBuffer, rPos, nFileId, rTabName, rRef, pRefMgr, true); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef, ScExternalRefManager* pRefMgr ) const { - makeExternalRefStrImpl( rBuffer, rCompiler, nFileId, rTabName, rRef, pRefMgr, true); + makeExternalRefStrImpl(rBuffer, rPos, nFileId, rTabName, rRef, pRefMgr, true); } }; @@ -1277,7 +1277,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL return ConventionXL::makeExternalNameStr(rFile, rName); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef, ScExternalRefManager* pRefMgr ) const { @@ -1295,10 +1295,10 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL ScRangeStringConverter::AppendTableName(rBuffer, rTabName); rBuffer.append('!'); - makeSingleCellStr(rBuffer, rRef, rRef.toAbs(rCompiler.GetPos())); + makeSingleCellStr(rBuffer, rRef, rRef.toAbs(rPos)); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef, ScExternalRefManager* pRefMgr ) const { @@ -1311,7 +1311,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL if (aTabNames.empty()) return; - ScRange aAbsRef = rRef.toAbs(rCompiler.GetPos()); + ScRange aAbsRef = rRef.toAbs(rPos); ConventionXL::makeExternalDocStr(rBuffer, *pFullName, false); ConventionXL::makeExternalTabNameRange(rBuffer, rTabName, aTabNames, aAbsRef); @@ -1470,7 +1470,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL return ConventionXL::makeExternalNameStr(rFile, rName); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef, ScExternalRefManager* pRefMgr ) const { @@ -1484,7 +1484,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL if (!pFullName) return; - ScAddress aAbsRef = rRef.toAbs(rCompiler.GetPos()); + ScAddress aAbsRef = rRef.toAbs(rPos); ConventionXL::makeExternalDocStr(rBuffer, *pFullName, false); ScRangeStringConverter::AppendTableName(rBuffer, rTabName); @@ -1494,7 +1494,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL r1c1_add_col(rBuffer, rRef, aAbsRef); } - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef, ScExternalRefManager* pRefMgr ) const { @@ -1507,7 +1507,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL if (aTabNames.empty()) return; - ScRange aAbsRef = rRef.toAbs(rCompiler.GetPos()); + ScRange aAbsRef = rRef.toAbs(rPos); ConventionXL::makeExternalDocStr(rBuffer, *pFullName, false); ConventionXL::makeExternalTabNameRange(rBuffer, rTabName, aTabNames, aAbsRef); @@ -4094,11 +4094,11 @@ void ScCompiler::CreateStringFromExternal(OUStringBuffer& rBuffer, FormulaToken* break; case svExternalSingleRef: pConv->makeExternalRefStr( - rBuffer, *this, t->GetIndex(), t->GetString().getString(), static_cast<ScToken*>(t)->GetSingleRef(), pRefMgr); + rBuffer, GetPos(), t->GetIndex(), t->GetString().getString(), static_cast<ScToken*>(t)->GetSingleRef(), pRefMgr); break; case svExternalDoubleRef: pConv->makeExternalRefStr( - rBuffer, *this, t->GetIndex(), t->GetString().getString(), static_cast<ScToken*>(t)->GetDoubleRef(), pRefMgr); + rBuffer, GetPos(), t->GetIndex(), t->GetString().getString(), static_cast<ScToken*>(t)->GetDoubleRef(), pRefMgr); break; default: // warning, not error, otherwise we may end up with a never |