sc/qa/unit/data/xlsx/tdf162093.xlsx     |binary
 sc/qa/unit/subsequent_filters_test4.cxx |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit aa5a10016b1d78c4913775ac8990cebe48f1e38e
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Jul 25 14:36:41 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Jul 25 18:58:22 2024 +0200

    tdf#162093: sc_subsequent_filters_test4: Add unittest
    
    Change-Id: Ib936cdb890cff18b6fac37ebbdd781c4aacc1986
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171013
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/sc/qa/unit/data/xlsx/tdf162093.xlsx 
b/sc/qa/unit/data/xlsx/tdf162093.xlsx
new file mode 100644
index 000000000000..9245327f7a4a
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf162093.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters_test4.cxx 
b/sc/qa/unit/subsequent_filters_test4.cxx
index 5cdcb4e68690..31d2d9c5c4eb 100644
--- a/sc/qa/unit/subsequent_filters_test4.cxx
+++ b/sc/qa/unit/subsequent_filters_test4.cxx
@@ -146,6 +146,28 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf76115)
     CPPUNIT_ASSERT_EQUAL(u"Filial"_ustr, pDoc->GetString(0, 0, 0));
 }
 
+CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf162093)
+{
+    createScDoc("xlsx/tdf162093.xlsx");
+
+    ScDocument* pDoc = getScDoc();
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: Surname
+    // - Actual  : #NAME?
+    CPPUNIT_ASSERT_EQUAL(u"Surname"_ustr, pDoc->GetString(5, 3, 0));
+    CPPUNIT_ASSERT_EQUAL(u"Count"_ustr, pDoc->GetString(6, 3, 0));
+    CPPUNIT_ASSERT_EQUAL(u"Region"_ustr, pDoc->GetString(7, 3, 0));
+
+    CPPUNIT_ASSERT_EQUAL(u"Murray"_ustr, pDoc->GetString(5, 4, 0));
+    CPPUNIT_ASSERT_EQUAL(u"15"_ustr, pDoc->GetString(6, 4, 0));
+    CPPUNIT_ASSERT_EQUAL(u"North"_ustr, pDoc->GetString(7, 4, 0));
+
+    CPPUNIT_ASSERT_EQUAL(u"Total"_ustr, pDoc->GetString(5, 14, 0));
+    CPPUNIT_ASSERT_EQUAL(u"296"_ustr, pDoc->GetString(6, 14, 0));
+    CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(7, 14, 0));
+}
+
 CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testLegacyOptionButtonGroupBox)
 {
     createScDoc("xls/tdf79542_radioGroupBox.xls");

Reply via email to