summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-10-18 13:36:49 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-10-18 15:37:40 +0200
commitf5ef4f27d5f2d82b28be690154102dae72f94545 (patch)
treebc3b4ec5a4e648fd715a266ecbabb3ce6eaede44 /sw/qa/extras/rtfimport
parent49e5e750b51ae8b6ff5f8f98beedea1b4737c2fc (diff)
fix import of RTF default page left/right margin
This is one more fallout from fdo#42407, which is still incomplete. Change-Id: Ie47f06be598ce5236c45bd3750ea7a21fd98175c
Diffstat (limited to 'sw/qa/extras/rtfimport')
-rw-r--r--sw/qa/extras/rtfimport/data/leftmargin-default.rtf5
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/leftmargin-default.rtf b/sw/qa/extras/rtfimport/data/leftmargin-default.rtf
new file mode 100644
index 000000000000..cf3ffd385c47
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/leftmargin-default.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+\margt0
+foo
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 9c278185c9eb..1ebadad841e7 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -119,6 +119,7 @@ public:
void testShptxtPard();
void testDoDhgt();
void testDplinehollow();
+ void testLeftmarginDefault();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -176,6 +177,7 @@ public:
CPPUNIT_TEST(testShptxtPard);
CPPUNIT_TEST(testDoDhgt);
CPPUNIT_TEST(testDplinehollow);
+ CPPUNIT_TEST(testLeftmarginDefault);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -936,6 +938,13 @@ void Test::testDplinehollow()
CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_NONE, getProperty<drawing::LineStyle>(xPropertySet, "LineStyle"));
}
+void Test::testLeftmarginDefault()
+{
+ // The default left/right margin was incorrect when the top margin was set to zero.
+ load("leftmargin-default.rtf");
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Default"), "LeftMargin"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();