diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-22 18:55:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-22 19:10:12 +0200 |
commit | 4148d1bd400fe86b44e527a9fe11613c4437594c (patch) | |
tree | 2752d26ab80f40deca3f00fc5b706babe44a8550 | |
parent | 52a0b3fade7551a0f16442201f27fcdb9396a78c (diff) |
fdo#46966 dmapper: fix headery/footery default value
The docx spec doesn't say what is the default value, the rtf spec says
it's 720, not 1440.
Change-Id: Icb331591d4f2f96a7786f808d99af5974e645f8e
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo46966.rtf | 10 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 17 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 |
3 files changed, 29 insertions, 1 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo46966.rtf b/sw/qa/extras/rtftok/data/fdo46966.rtf new file mode 100644 index 000000000000..de0f7dff9c2f --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo46966.rtf @@ -0,0 +1,10 @@ +{\rtf1\ansi +{\fonttbl{\f0 Times New Roman;}} +{\stylesheet{\s0\snext0\f0\fs24 Normal;}} + +\margl720\margr1440\margt720\margb1440 +\sectd +\marglsxn720\margrsxn1440\margtsxn720\margbsxn1440 +{\header Header} +Text +\par } diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index e7ed1bb82297..fef82e2f19fa 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -96,6 +96,7 @@ public: void testFdo50539(); void testFdo50665(); void testFdo49659(); + void testFdo46966(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -135,6 +136,7 @@ public: CPPUNIT_TEST(testFdo50539); CPPUNIT_TEST(testFdo50665); CPPUNIT_TEST(testFdo49659); + CPPUNIT_TEST(testFdo46966); #endif CPPUNIT_TEST_SUITE_END(); @@ -794,6 +796,21 @@ void Test::testFdo49659() CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, nValue); } +void Test::testFdo46966() +{ + /* + * The problem was the top margin was 1440 (1 inch), but it should be 720 (0.5 inch). + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin + */ + load("fdo46966.rtf"); + + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("TopMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), nValue); +} + 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 a38aec4b2ce6..8e6d2c63c245 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3370,7 +3370,8 @@ void DomainMapper_Impl::SetPageMarginTwip( PageMarElement eElement, sal_Int32 nV _PageMar::_PageMar() { - header = footer = top = bottom = ConversionHelper::convertTwipToMM100( sal_Int32(1440)); + header = footer = ConversionHelper::convertTwipToMM100(sal_Int32(720)); + top = bottom = ConversionHelper::convertTwipToMM100( sal_Int32(1440)); right = left = ConversionHelper::convertTwipToMM100( sal_Int32(1800)); gutter = 0; } |