sw/qa/extras/htmlimport/data/tdf154273.html | 9 +++++++++ sw/qa/extras/htmlimport/htmlimport.cxx | 10 ++++++++++ 2 files changed, 19 insertions(+)
New commits: commit 92b732ce29f734d91fb6c9350b9a8b6df7f9293e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Mar 20 16:20:54 2023 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Mar 20 20:16:51 2023 +0000 tdf#154273: sw_htmlimport: Add unittest Change-Id: I9d65f514979bbd24380210dc9006b6ed2649b37a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149165 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/htmlimport/data/tdf154273.html b/sw/qa/extras/htmlimport/data/tdf154273.html new file mode 100644 index 000000000000..6a8b8dc6380b --- /dev/null +++ b/sw/qa/extras/htmlimport/data/tdf154273.html @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"> + </head> + <body> + 'test' + </body> +</html> diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index fe062f5c83fd..41efcee327f3 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -520,6 +520,16 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testUTF16_nonBMP) getParagraph(1)->getString()); } +CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf154273) +{ + createSwWebDoc("tdf154273.html"); + + // Without the fix in place, this test would have failed with + // - Expected: 'test' + // - Actual : 'test' + CPPUNIT_ASSERT_EQUAL(OUString("'test' "), getParagraph(1)->getString()); +} + CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleData) { // Given an XHTML with an <object> (containing non-image, non-OLE2 data) and an inner <object>