diff options
-rw-r--r-- | sw/qa/extras/rtfimport/data/leftmargin-default.rtf | 5 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 |
3 files changed, 17 insertions, 1 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(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 4ea99838b9de..069e94c4b4c5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3471,7 +3471,9 @@ _PageMar::_PageMar() { header = footer = ConversionHelper::convertTwipToMM100(sal_Int32(720)); top = bottom = ConversionHelper::convertTwipToMM100( sal_Int32(1440)); - right = left = ConversionHelper::convertTwipToMM100( sal_Int32(1800)); + // This is strange, the RTF spec says it's 1800, but it's clearly 1440 in Word + // OOXML seems not to specify a default value + right = left = ConversionHelper::convertTwipToMM100( sal_Int32(1440)); gutter = 0; } |