[Libreoffice-commits] core.git: sc/qa

Markus Mohrhard markus.mohrhard at googlemail.com
Sun May 1 09:45:02 UTC 2016


 sc/qa/unit/ucalc.hxx         |    4 ++++
 sc/qa/unit/ucalc_formula.cxx |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

New commits:
commit 8465e99a27168a2c0a62e84b819e9e133f47ddf8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Apr 30 22:33:16 2016 +0200

    add test for tdf#98990
    
    Change-Id: I0789d250aa52994948c392c1e8f06c5546defc8f
    Reviewed-on: https://gerrit.libreoffice.org/24546
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 9427367..6896c8e 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -198,6 +198,8 @@ public:
     void testFuncMDETERM();
     void testMatConcat();
     void testMatConcatReplication();
+    void testRefR1C1WholeCol();
+    void testRefR1C1WholeRow();
 
     void testExternalRef();
     void testExternalRefFunctions();
@@ -550,6 +552,8 @@ public:
     CPPUNIT_TEST(testFuncIFERROR);
     CPPUNIT_TEST(testFuncGETPIVOTDATA);
     CPPUNIT_TEST(testFuncGETPIVOTDATALeafAccess);
+    CPPUNIT_TEST(testRefR1C1WholeCol);
+    CPPUNIT_TEST(testRefR1C1WholeRow);
     CPPUNIT_TEST(testMatrixOp);
     CPPUNIT_TEST(testFuncRangeOp);
     CPPUNIT_TEST(testFuncFORMULA);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index d47ea6a..54f1318 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -7176,4 +7176,36 @@ void Test::testMatConcatReplication()
     m_pDoc->DeleteTab(0);
 }
 
+void Test::testRefR1C1WholeCol()
+{
+    CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+
+    ScAddress aPos(1, 1, 1);
+    ScCompiler aComp(m_pDoc, aPos);
+    aComp.SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
+    std::unique_ptr<ScTokenArray> pTokens(aComp.CompileString("=C[10]"));
+    sc::TokenStringContext aCxt(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
+    OUString aFormula = pTokens->CreateString(aCxt, aPos);
+
+    CPPUNIT_ASSERT_EQUAL(OUString("L:L"), aFormula);
+
+    m_pDoc->DeleteTab(0);
+}
+
+void Test::testRefR1C1WholeRow()
+{
+    CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+
+    ScAddress aPos(1, 1, 1);
+    ScCompiler aComp(m_pDoc, aPos);
+    aComp.SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
+    std::unique_ptr<ScTokenArray> pTokens(aComp.CompileString("=R[3]"));
+    sc::TokenStringContext aCxt(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
+    OUString aFormula = pTokens->CreateString(aCxt, aPos);
+
+    CPPUNIT_ASSERT_EQUAL(OUString("5:5"), aFormula);
+
+    m_pDoc->DeleteTab(0);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list