tdf#142293, tdf#141495: sc_subsequent_filters_test2: Add unittest
Change-Id: Icca8f402a960ac9de9a4f4d2c9f8d00f5abd0d37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136188
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/data/xlsx/tdf141495.xlsx b/sc/qa/unit/data/xlsx/tdf141495.xlsx
new file mode 100644
index 0000000..3b065f0
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf141495.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx
index 05a393a..8f747f5 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -154,6 +154,7 @@ public:
void testColumnWidthRowHeightXLSXML();
void testCharacterSetXLSXML();
void testTdf137091();
void testTdf141495();
void testTdf70455();
void testTdf62268();
void testTdf137453();
@@ -268,6 +269,7 @@ public:
CPPUNIT_TEST(testCharacterSetXLSXML);
CPPUNIT_TEST(testCondFormatFormulaListenerXLSX);
CPPUNIT_TEST(testTdf137091);
CPPUNIT_TEST(testTdf141495);
CPPUNIT_TEST(testTdf70455);
CPPUNIT_TEST(testTdf62268);
CPPUNIT_TEST(testTdf137453);
@@ -2261,6 +2263,30 @@ void ScFiltersTest2::testTdf137091()
xDocSh->DoClose();
}
void ScFiltersTest2::testTdf141495()
{
// Set the system locale to Turkish
SvtSysLocaleOptions aOptions;
OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47();
aOptions.SetLocaleConfigString("tr-TR");
aOptions.Commit();
comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] {
aOptions.SetLocaleConfigString(sLocaleConfigString);
aOptions.Commit();
});
ScDocShellRef xDocSh = loadDoc(u"tdf141495.", FORMAT_XLSX);
ScDocument& rDoc = xDocSh->GetDocument();
xDocSh->DoHardRecalc();
// Without the fix in place, this test would have failed with
// - Expected: 44956
// - Actual : #ADDIN?
CPPUNIT_ASSERT_EQUAL(OUString("44956"), rDoc.GetString(ScAddress(11, 6, 0)));
xDocSh->DoClose();
}
void ScFiltersTest2::testTdf70455()
{
ScDocShellRef xDocSh = loadDoc(u"tdf70455.", FORMAT_XLSX);