summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-11-22 16:34:18 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-22 16:59:56 +0100
commita56bfe734a7bed40a175e0eeb7e86e7006a83f83 (patch)
tree438c14f1ec41549522d196810e57689118664287
parentedb0626a37f16b1bf705e8902f0c46ed46a6d0cd (diff)
cp#1000016 DOCX/RTF import: fix RemoveLastParagraph() on Windows
Change-Id: I3f9d69ddbb2144c60a724e4242128b65ae167455
-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");