summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtftok/data/fdo43965.rtf16
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx35
2 files changed, 51 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo43965.rtf b/sw/qa/extras/rtftok/data/fdo43965.rtf
new file mode 100644
index 000000000000..968fe77e2782
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo43965.rtf
@@ -0,0 +1,16 @@
+{\rtf1\ansi\ansicpg1252
+{\fonttbl \f0\froman\fcharset0 Times;\f1\fswiss\fcharset0 Helvetica;}
+{\info{\subject Test file for LibreOffice 3.5}}
+\margl1440\margr1440\margt1440\margb1440\deftab720\viewkind1\viewscale100
+\pard\pardeftab720\ql\qnatural
+\f0\fs36
+{
+{\fs22\up8 2}
+}\
+{\box\brdrs Box
+}\
+Page feeds:\
+ This is on the first page.\
+\page
+ This is on the second page.\
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 95fc51b74a1d..c376779d5b0d 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -33,9 +33,11 @@
#include <com/sun/star/table/BorderLineStyle.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/SizeType.hpp>
+#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <rtl/oustringostreaminserter.hxx>
#include <test/bootstrapfixture.hxx>
@@ -64,6 +66,7 @@ public:
void testFdo46662();
void testN750757();
void testFdo45563();
+ void testFdo43965();
CPPUNIT_TEST_SUITE(RtfModelTest);
#if !defined(MACOSX) && !defined(WNT)
@@ -76,6 +79,7 @@ public:
CPPUNIT_TEST(testFdo46662);
CPPUNIT_TEST(testN750757);
CPPUNIT_TEST(testFdo45563);
+ CPPUNIT_TEST(testFdo43965);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -339,6 +343,37 @@ void RtfModelTest::testFdo45563()
CPPUNIT_ASSERT_EQUAL(4, i);
}
+void RtfModelTest::testFdo43965()
+{
+ load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo43965.rtf")));
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+
+ // First paragraph: the parameter of \up was ignored
+ uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nValue;
+ xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharEscapement"))) >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(58), nValue);
+ xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharEscapementHeight"))) >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(100), nValue);
+
+ // Second paragraph: Word vs Writer border default problem
+ xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
+ table::BorderLine2 aBorder;
+ xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TopBorder"))) >>= aBorder;
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), aBorder.LineWidth);
+
+ // Finally, make sure that we have two pages
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ xCursor->jumpToLastPage();
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();