summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx19
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx2
2 files changed, 18 insertions, 3 deletions
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index f1db5f6e600a..78fafea554d5 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 d88ca499d0fc..3181c9f42657 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");