[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 1 16:13:39 UTC 2018


 sw/qa/extras/ooxmlexport/data/tdf105444.docx      |binary
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx        |    9 +++++++++
 sw/qa/extras/uiwriter/uiwriter.cxx                |   10 +---------
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    4 +++-
 4 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 88188dd62d1d1e3caa1b8ee03fdf246aafdec71e
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Fri Sep 21 12:38:48 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Mon Oct 1 18:13:16 2018 +0200

    tdf#105444 DOCX import: don't put extra paragraphs in comments
    
    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 <nemeth at numbertext.org>
    (cherry picked from commit bdade7e3fc33c1832c6f6a472443fca8238738d2)
    Reviewed-on: https://gerrit.libreoffice.org/60896

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 4fda4e47a930..d7d41b1d1e36 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -762,6 +762,15 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx")
     CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference >= -4);
 }
 
+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 619ba37ab9bb..6d1f2c51c684 100755
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -5399,15 +5399,7 @@ void SwUiWriterTest::testCreateDocxAnnotation()
     uno::Reference<beans::XPropertySet> 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<OUString>());
+    CPPUNIT_ASSERT_EQUAL(aSomeText, xField->getPropertyValue("Content").get<OUString>());
 }
 
 void SwUiWriterTest::testTdf107976()
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index aff0159140e6..444b19c6de6c 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -432,7 +432,9 @@ void DomainMapper_Impl::RemoveLastParagraph( )
             xCursor->goLeft( 1, true );
             // If this is a text on a shape, possibly the text has the trailing
             // newline removed already.
-            if (xCursor->getString() == SAL_NEWLINE_STRING)
+            if (xCursor->getString() == SAL_NEWLINE_STRING ||
+                    // tdf#105444 comments need an exception, if SAL_NEWLINE_STRING defined as "\r\n"
+                    (sizeof(SAL_NEWLINE_STRING)-1 == 2 && xCursor->getString() == "\n"))
             {
                 uno::Reference<beans::XPropertySet> xDocProps(GetTextDocument(), uno::UNO_QUERY);
                 const OUString aRecordChanges("RecordChanges");


More information about the Libreoffice-commits mailing list