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

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Mar 19 21:08:53 UTC 2017


 sc/qa/unit/ucalc.hxx         |    2 ++
 sc/qa/unit/ucalc_formula.cxx |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

New commits:
commit 47d4f6252df2ec3cc9f7363ce37e043dcec20f2e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 18 20:14:24 2017 +0100

    add test for tdf#93151
    
    Change-Id: Ia51c50d29b4790d88e8b8e4b0708d6995d4226f7
    Reviewed-on: https://gerrit.libreoffice.org/35440
    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 b172776c0ac5..4d3558a71393 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -155,6 +155,7 @@ public:
     void testFormulaRefUpdateName();
     void testFormulaRefUpdateNameMove();
     void testFormulaRefUpdateNameExpandRef();
+    void testFormulaRefUpdateNameExpandRef2();
     void testFormulaRefUpdateNameDeleteRow();
     void testFormulaRefUpdateNameCopySheet();
     void testFormulaRefUpdateNameCopySheetCheckTab( SCTAB Tab, bool bCheckNames );
@@ -553,6 +554,7 @@ public:
     CPPUNIT_TEST(testFormulaRefUpdateName);
     CPPUNIT_TEST(testFormulaRefUpdateNameMove);
     CPPUNIT_TEST(testFormulaRefUpdateNameExpandRef);
+    CPPUNIT_TEST(testFormulaRefUpdateNameExpandRef2);
     CPPUNIT_TEST(testFormulaRefUpdateNameDeleteRow);
     CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
     CPPUNIT_TEST(testFormulaRefUpdateNameDelete);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 6c288bce48e4..c11ecab06628 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -2901,6 +2901,33 @@ void Test::testFormulaRefUpdateNameExpandRef()
     m_pDoc->DeleteTab(0);
 }
 
+void Test::testFormulaRefUpdateNameExpandRef2()
+{
+    setExpandRefs(true);
+
+    sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
+
+    m_pDoc->InsertTab(0, "Test");
+
+    bool bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$A$1:$B$3");
+    CPPUNIT_ASSERT(bInserted);
+
+    // Insert a new row at row 4, which should expand the named range to A1:A4.
+    ScDocFunc& rFunc = getDocShell().GetDocFunc();
+    ScMarkData aMark;
+    aMark.SelectOneTable(0);
+
+    // Insert a new column at column 3, which should expand the named
+    rFunc.InsertCells(ScRange(1,0,0,1,MAXROW,0), &aMark, INS_INSCOLS_BEFORE, false, true);
+    ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
+    CPPUNIT_ASSERT(pName);
+    OUString aSymbol;
+    pName->GetSymbol(aSymbol, m_pDoc->GetGrammar());
+    CPPUNIT_ASSERT_EQUAL(OUString("$A$1:$C$3"), aSymbol);
+
+    m_pDoc->DeleteTab(0);
+}
+
 void Test::testFormulaRefUpdateNameDeleteRow()
 {
     m_pDoc->InsertTab(0, "Test");


More information about the Libreoffice-commits mailing list