diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2021-08-18 11:51:07 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-08-18 20:28:46 +0200 |
commit | d1d6c1535e51ef364a71d3d4c5bd331af88fce32 (patch) | |
tree | da4d8854e341128e9c2b482c05ad07bad362275b | |
parent | 2d5ba784a341aea1b7b2403842d2521d1548ea8f (diff) |
tdf#118470: unit test for escaped unicode chars in strings import
Conflicts:
sc/qa/unit/subsequent_filters-test.cxx
Change-Id: I4c4190538bdcb3292546d6d5884eb7900807060c
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120666
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sc/qa/unit/data/xlsx/escape-unicode.xlsx | bin | 0 -> 6435 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 13 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/escape-unicode.xlsx b/sc/qa/unit/data/xlsx/escape-unicode.xlsx Binary files differnew file mode 100644 index 000000000000..ec43688b74b8 --- /dev/null +++ b/sc/qa/unit/data/xlsx/escape-unicode.xlsx diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index c98f6ca0a439..cc7fe47271be 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -216,6 +216,7 @@ public: void testTdf139782(); void testTdf129681(); void testTdf111974XLSM(); + void testEscapedUnicodeXLSX(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testCondFormatOperatorsSameRangeXLSX); @@ -318,6 +319,7 @@ public: CPPUNIT_TEST(testTdf139782); CPPUNIT_TEST(testTdf129681); CPPUNIT_TEST(testTdf111974XLSM); + CPPUNIT_TEST(testEscapedUnicodeXLSX); CPPUNIT_TEST_SUITE_END(); @@ -3125,6 +3127,17 @@ void ScFiltersTest::testTdf129681() void ScFiltersTest::testTdf111974XLSM() { testImportCrash(u"tdf111974.", FORMAT_XLSM); } +void ScFiltersTest::testEscapedUnicodeXLSX() +{ + ScDocShellRef xDocSh = loadDoc(u"escape-unicode.", FORMAT_XLSX); + ScDocument& rDoc = xDocSh->GetDocument(); + + // Without the fix, there would be "_x000D_" after every new-line char. + CPPUNIT_ASSERT_EQUAL(OUString("Line 1\nLine 2\nLine 3\nLine 4"), rDoc.GetString(1, 1, 0)); + + xDocSh->DoClose(); +} + ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "sc/qa/unit/data" ) { |