diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-05-09 11:30:13 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-05-09 12:04:45 +0200 |
commit | d6acd86fe1d2924a378e3053f83d47084a8bb108 (patch) | |
tree | 2c05c06c8f2d7fba941d4a981111a72026a3eaa9 /sw | |
parent | 46fee7c2b23e9f252e9f223950718430c0990e61 (diff) |
fdo#49501 RTF_MARGL/R/T/B should also set the current margin
Change-Id: I I69b92d0cd07c9f08f14affb447b55b26b2556186
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo49501.rtf | 5 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo49501.rtf b/sw/qa/extras/rtftok/data/fdo49501.rtf new file mode 100644 index 000000000000..47bd691b8e62 --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo49501.rtf @@ -0,0 +1,5 @@ +{\rtf +\landscape \paperw15309 \paperh11907 \margl567 \margr567 \margt567 \margb567 +Department +\par +} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index 605a20dde583..e6de8431a34c 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -95,6 +95,7 @@ public: void testFdo47764(); void testFdo38786(); void testN757651(); + void testFdo49501(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -127,6 +128,7 @@ public: CPPUNIT_TEST(testFdo47764); CPPUNIT_TEST(testFdo38786); CPPUNIT_TEST(testN757651); + CPPUNIT_TEST(testFdo49501); #endif CPPUNIT_TEST_SUITE_END(); @@ -701,6 +703,30 @@ void Test::testN757651() CPPUNIT_ASSERT_EQUAL(1, getPages()); } +void Test::testFdo49501() +{ + load("fdo49501.rtf"); + + uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xStyles(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xPageStyles(xStyles->getByName("PageStyles"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY); + + sal_Bool bIsLandscape = sal_False; + xStyle->getPropertyValue("IsLandscape") >>= bIsLandscape; + CPPUNIT_ASSERT_EQUAL(sal_True, bIsLandscape); + sal_Int32 nExpected(TWIP_TO_MM100(567)); + sal_Int32 nValue = 0; + xStyle->getPropertyValue("LeftMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); + xStyle->getPropertyValue("RightMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); + xStyle->getPropertyValue("TopMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); + xStyle->getPropertyValue("BottomMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |