summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/qa/unit/ucalc.hxx4
-rw-r--r--sc/qa/unit/ucalc_formula.cxx32
2 files changed, 36 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 9427367ca6a6..6896c8e6e0e9 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 d47ea6aa54e2..54f1318948ea 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: */