summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-10-22 14:44:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-10-23 09:30:08 +0200
commit512ed170fe6c345fbb882c23e40ee9e884ff2f28 (patch)
treeeb03a42c7cc28222c34632d04ac125e6a9f40987
parent1ba2028ab93a649ddab9b7253ea7ef7e7cf6d40f (diff)
Turn static ScToken::ExtendRangeReference into free function
...and rename to extendRangeReference to avoid confusion with formula::FormulaCompiler::ExtendRangeReference. Change-Id: Ifcad309c14e04a0e37c80ca44462da587387241d
-rw-r--r--sc/inc/token.hxx28
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/interpr2.cxx2
-rw-r--r--sc/source/core/tool/token.cxx6
4 files changed, 19 insertions, 19 deletions
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index 7ce60e231620..fd8c8844b38c 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -93,22 +93,22 @@ public:
#if DEBUG_FORMULA_COMPILER
virtual void Dump() const;
#endif
-
- /** If rTok1 and rTok2 both are SingleRef or DoubleRef tokens, extend/merge
- ranges as needed for ocRange.
- @param rPos
- The formula's position, used to calculate absolute positions from
- relative references.
- @param bReuseDoubleRef
- If true, a DoubleRef token is reused if passed as rTok1 or rTok2,
- else a new DoubleRef token is created and returned.
- @return
- A reused or new'ed ScDoubleRefToken, or a NULL TokenRef if rTok1 or
- rTok2 are not of sv(Single|Double)Ref
- */
- static formula::FormulaTokenRef ExtendRangeReference( formula::FormulaToken & rTok1, formula::FormulaToken & rTok2, const ScAddress & rPos, bool bReuseDoubleRef );
};
+/** If rTok1 and rTok2 both are SingleRef or DoubleRef tokens, extend/merge
+ ranges as needed for ocRange.
+ @param rPos
+ The formula's position, used to calculate absolute positions from
+ relative references.
+ @param bReuseDoubleRef
+ If true, a DoubleRef token is reused if passed as rTok1 or rTok2,
+ else a new DoubleRef token is created and returned.
+ @return
+ A reused or new'ed ScDoubleRefToken, or a NULL TokenRef if rTok1 or
+ rTok2 are not of sv(Single|Double)Ref
+*/
+formula::FormulaTokenRef extendRangeReference( formula::FormulaToken & rTok1, formula::FormulaToken & rTok2, const ScAddress & rPos, bool bReuseDoubleRef );
+
inline void intrusive_ptr_add_ref(const ScToken* p)
{
p->IncRef();
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 7840c9ddbaf5..33146a7ab12f 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4561,7 +4561,7 @@ bool ScCompiler::HandleDbData()
FormulaTokenRef ScCompiler::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, bool bReuseDoubleRef )
{
- return ScToken::ExtendRangeReference( rTok1, rTok2, aPos,bReuseDoubleRef );
+ return extendRangeReference( rTok1, rTok2, aPos,bReuseDoubleRef );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index cadc47b79205..183e4ae7f7e3 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2073,7 +2073,7 @@ void ScInterpreter::ScRangeFunc()
PushIllegalArgument();
return;
}
- FormulaTokenRef xRes = ScToken::ExtendRangeReference( *x1, *x2, aPos, false);
+ FormulaTokenRef xRes = extendRangeReference( *x1, *x2, aPos, false);
if (!xRes)
PushIllegalArgument();
else
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 7011536216f9..dba75fb7e96a 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -513,7 +513,7 @@ void ScToken::Dump() const
}
#endif
-FormulaTokenRef ScToken::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2,
+FormulaTokenRef extendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2,
const ScAddress & rPos, bool bReuseDoubleRef )
{
@@ -1966,12 +1966,12 @@ FormulaToken* ScTokenArray::MergeRangeReference( const ScAddress & rPos )
return NULL;
sal_uInt16 nIdx = nLen;
FormulaToken *p1, *p2, *p3; // ref, ocRange, ref
- // The actual types are checked in ExtendRangeReference().
+ // The actual types are checked in extendRangeReference().
if (((p3 = PeekPrev(nIdx)) != 0) &&
(((p2 = PeekPrev(nIdx)) != 0) && p2->GetOpCode() == ocRange) &&
((p1 = PeekPrev(nIdx)) != 0))
{
- FormulaTokenRef p = ScToken::ExtendRangeReference( *p1, *p3, rPos, true);
+ FormulaTokenRef p = extendRangeReference( *p1, *p3, rPos, true);
if (p)
{
p->IncRef();