[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/qa

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Sat Nov 23 07:51:12 UTC 2019


 sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx |binary
 sc/qa/unit/filters-test.cxx                        |   31 +++++++++++++++++++++
 2 files changed, 31 insertions(+)

New commits:
commit a297c6a8c71a8cb07ede3b2305760a1d41b9fb6a
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Thu Nov 21 14:17:22 2019 +0530
Commit:     Xisco FaulĂ­ <xiscofauli at libreoffice.org>
CommitDate: Sat Nov 23 08:50:11 2019 +0100

    tdf#128894: unit test for the bugfix
    
    Change-Id: Ic6d3910f12409f5af541c887760caefcb78b30f9
    Reviewed-on: https://gerrit.libreoffice.org/83362
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.francis at collabora.com>
    (cherry picked from commit 626d1527267ab856e516f2424173104f781b8f09)
    Reviewed-on: https://gerrit.libreoffice.org/83514
    Reviewed-by: Xisco FaulĂ­ <xiscofauli at libreoffice.org>

diff --git a/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx b/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx
new file mode 100644
index 000000000000..fa386d3a4384
Binary files /dev/null and b/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index d747edcbd7a2..4551ee4d9fb7 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -68,6 +68,7 @@ public:
     void testContentGnumeric();
     void testSharedFormulaXLS();
     void testSharedFormulaXLSX();
+    void testSharedFormulaRefUpdateXLSX();
     void testSheetNamesXLSX();
     void testLegacyCellAnchoredRotatedShape();
     void testEnhancedProtectionXLS();
@@ -92,6 +93,7 @@ public:
     CPPUNIT_TEST(testContentGnumeric);
     CPPUNIT_TEST(testSharedFormulaXLS);
     CPPUNIT_TEST(testSharedFormulaXLSX);
+    CPPUNIT_TEST(testSharedFormulaRefUpdateXLSX);
     CPPUNIT_TEST(testSheetNamesXLSX);
     CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape);
     CPPUNIT_TEST(testEnhancedProtectionXLS);
@@ -419,6 +421,35 @@ void ScFiltersTest::testSharedFormulaXLSX()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testSharedFormulaRefUpdateXLSX()
+{
+    ScDocShellRef xDocSh = loadDoc("shared-formula/refupdate.", FORMAT_XLSX);
+    ScDocument& rDoc = xDocSh->GetDocument();
+    sc::AutoCalcSwitch aACSwitch(rDoc, true); // turn auto calc on.
+    rDoc.DeleteRow(ScRange(0, 4, 0, rDoc.MaxCol(), 4, 0)); // delete row 5.
+
+    struct TestCase {
+        ScAddress aPos;
+        const char* pExpectedFormula;
+        const char* pErrorMsg;
+    };
+
+    TestCase aCases[4] = {
+        { ScAddress(1, 0, 0),  "B29+1", "Wrong formula in B1" },
+        { ScAddress(2, 0, 0),  "C29+1", "Wrong formula in C1" },
+        { ScAddress(3, 0, 0),  "D29+1", "Wrong formula in D1" },
+        { ScAddress(4, 0, 0),  "E29+1", "Wrong formula in E1" },
+    };
+
+    for (size_t nIdx = 0; nIdx < 4; ++nIdx)
+    {
+        TestCase& rCase = aCases[nIdx];
+        ASSERT_FORMULA_EQUAL(rDoc, rCase.aPos, rCase.pExpectedFormula, rCase.pErrorMsg);
+    }
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testSheetNamesXLSX()
 {
     ScDocShellRef xDocSh = loadDoc("sheet-names.", FORMAT_XLSX);


More information about the Libreoffice-commits mailing list