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

Miklos Vajna vmiklos at collabora.co.uk
Fri Nov 22 09:51:24 PST 2013


 sw/qa/extras/rtfimport/rtfimport.cxx              |   19 +++++++++++++++++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    2 +-
 2 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit e8887be76309052b6f5a9edceca3630a7abd6dfd
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Nov 22 16:34:18 2013 +0100

    cp#1000016 DOCX/RTF import: fix RemoveLastParagraph() on Windows
    
    Change-Id: I3f9d69ddbb2144c60a724e4242128b65ae167455
    (cherry picked from commit a56bfe734a7bed40a175e0eeb7e86e7006a83f83)

diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index f1db5f6..78fafea 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -8,8 +8,6 @@
 
 #include <swmodeltestbase.hxx>
 
-#if !defined(MACOSX) && !defined(WNT)
-
 #include <com/sun/star/awt/FontDescriptor.hpp>
 #include <com/sun/star/document/XFilter.hpp>
 #include <com/sun/star/document/XImporter.hpp>
@@ -110,6 +108,8 @@ protected:
 
 #define DECLARE_RTFIMPORT_TEST(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test)
 
+#if !defined(MACOSX) && !defined(WNT)
+
 DECLARE_RTFIMPORT_TEST(testFdo45553, "fdo45553.rtf")
 {
     uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
@@ -1367,6 +1367,21 @@ DECLARE_RTFIMPORT_TEST(testCp1000018, "cp1000018.rtf")
 
 #endif
 
+DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf")
+{
+    // The single-line document had a second fake empty para on Windows.
+    bool bFound = true;
+    try
+    {
+        getParagraph(2);
+    }
+    catch (const container::NoSuchElementException&)
+    {
+        bFound = false;
+    }
+    CPPUNIT_ASSERT_EQUAL(false, bFound);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d88ca49..3181c9f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -299,7 +299,7 @@ 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() == "\n")
+            if (xCursor->getString() == SAL_NEWLINE_STRING)
             {
                 uno::Reference<beans::XPropertySet> xDocProps(GetTextDocument(), uno::UNO_QUERY);
                 const OUString aRecordChanges("RecordChanges");


More information about the Libreoffice-commits mailing list