From bdade7e3fc33c1832c6f6a472443fca8238738d2 Mon Sep 17 00:00:00 2001 From: László Németh Date: Fri, 21 Sep 2018 12:38:48 +0200 Subject: tdf#105444 DOCX import: don't put extra paragraphs in comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on Win32, waiting only for \r\n instead of \n in RemoveLastParagraph(). Change-Id: I8921a6a72e8397ed04edb9f339ba3f0bf5bbb98b Reviewed-on: https://gerrit.libreoffice.org/60865 Tested-by: Jenkins Reviewed-by: László Németh --- sw/qa/extras/ooxmlexport/data/tdf105444.docx | Bin 0 -> 4928 bytes sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 9 +++++++++ sw/qa/extras/uiwriter/uiwriter.cxx | 10 +--------- 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf105444.docx (limited to 'sw/qa') diff --git a/sw/qa/extras/ooxmlexport/data/tdf105444.docx b/sw/qa/extras/ooxmlexport/data/tdf105444.docx new file mode 100644 index 000000000000..a6e0ea8732e3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf105444.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 61388952f583..2b55c3f1ecfd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -797,6 +797,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx") sParaText); } +DECLARE_OOXMLEXPORT_TEST(testTdf105444, "tdf105444.docx") +{ + xmlDocPtr pXmlComm = parseExport("word/comments.xml"); + if (!pXmlComm) + return; + // there is no extra paragraph on Win32, only a single one. + assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 0bb8c12afab1..12c3e08cb150 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -5405,15 +5405,7 @@ void SwUiWriterTest::testCreateDocxAnnotation() uno::Reference xField(xFields->nextElement(), uno::UNO_QUERY); // this was empty instead of "some text" - OUString aResultText = aSomeText -#ifdef WNT - // FIXME From some unclear reason, on windows we get an additional - // paragraph in the comment - please adapt this test when that gets - // fixed. - + "\n" -#endif - ; - CPPUNIT_ASSERT_EQUAL(aResultText, xField->getPropertyValue("Content").get()); + CPPUNIT_ASSERT_EQUAL(aSomeText, xField->getPropertyValue("Content").get()); } void SwUiWriterTest::testTdf107976() -- cgit