summaryrefslogtreecommitdiff
path: root/sc/qa/unit/helper
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-14 21:05:56 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-14 22:54:49 -0400
commit12383c8d7465d7057b49844695b3fc34b51186ca (patch)
tree9131130fc4c0ab22890c5cbba44396784e19f83b /sc/qa/unit/helper
parentc288b17cc5a1d5051325e02a29aa40df5be6f016 (diff)
Write test for RPN token generation with and without jump command reordering.
Change-Id: I45d83448be04e0983f39ca28392671cf84ae928c
Diffstat (limited to 'sc/qa/unit/helper')
-rw-r--r--sc/qa/unit/helper/qahelper.cxx12
-rw-r--r--sc/qa/unit/helper/qahelper.hxx4
2 files changed, 16 insertions, 0 deletions
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 951cd613b64a..91b4a12d1724 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -473,6 +473,18 @@ bool checkFormulaPositions(
return true;
}
+ScTokenArray* compileFormula(
+ ScDocument* pDoc, const OUString& rFormula, const ScAddress* pPos,
+ formula::FormulaGrammar::Grammar eGram )
+{
+ ScAddress aPos(0,0,0);
+ if (pPos)
+ aPos = *pPos;
+ ScCompiler aComp(pDoc, aPos);
+ aComp.SetGrammar(eGram);
+ return aComp.CompileString(rFormula);
+}
+
void clearFormulaCellChangedFlag( ScDocument& rDoc, const ScRange& rRange )
{
const ScAddress& s = rRange.aStart;
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 915d167b10fb..805c6d2a596a 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -125,6 +125,10 @@ SCQAHELPER_DLLPUBLIC bool checkFormulaPosition(ScDocument& rDoc, const ScAddress
SCQAHELPER_DLLPUBLIC bool checkFormulaPositions(
ScDocument& rDoc, SCTAB nTab, SCCOL nCol, const SCROW* pRows, size_t nRowCount);
+SCQAHELPER_DLLPUBLIC ScTokenArray* compileFormula(
+ ScDocument* pDoc, const OUString& rFormula, const ScAddress* pPos = NULL,
+ formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_NATIVE );
+
template<size_t _Size>
bool checkOutput(ScDocument* pDoc, const ScRange& aOutRange, const char* aOutputCheck[][_Size], const char* pCaption)
{