diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-05 17:08:20 +0200 |
---|---|---|
committer | Bosdonnat Cedric <cedric.bosdonnat@free.fr> | 2013-08-07 07:31:30 +0000 |
commit | 0fabc1154c962e8f2884f9afaa37b666b08cf833 (patch) | |
tree | 29b3b607925353840d0917a1c5c49f82d856cf07 /sw | |
parent | 57de36c208a2a745bd40fad452d7a62871829d71 (diff) |
fdo#67498 RTF import: fix missing margins vs continuous section breaks
The document had 3 sections, separated by continuous section breaks.
Previously only margins from the last section were imported, this way
the first page had default margins.
Now margins are also applied when we hit continuous section breaks. This
way margin values from the last section break affecting the page wins. A
later commit could improve this further by setting the minimum of these
and setting a section margin for each non-minimal sections.
(cherry picked from commit c7884509a84d46a9d99b2950159d949589862f3a)
Conflicts:
writerfilter/source/dmapper/PropertyMap.cxx
Change-Id: I4d9a4585e795220533909bd1d467d933caaa0d71
Reviewed-on: https://gerrit.libreoffice.org/5286
Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo67498.rtf | 5 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo67498.rtf b/sw/qa/extras/rtfimport/data/fdo67498.rtf new file mode 100644 index 000000000000..f1058c0ae9c2 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo67498.rtf @@ -0,0 +1,5 @@ +{\rtf1\paperw11906\paperh16838\margl5954\margr454\margt567\margb8505\sectd\sbknone +a\sect\sectd\sbknone +b\sect\sectd +c\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 455c3a28532b..dd8b72cc6e46 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -148,6 +148,7 @@ public: void testFdo54900(); void testFdo64637(); void testFdo67365(); + void testFdo67498(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -283,6 +284,7 @@ void Test::run() {"fdo54900.rtf", &Test::testFdo54900}, {"fdo64637.rtf", &Test::testFdo64637}, {"fdo67365.rtf", &Test::testFdo67365}, + {"fdo67498.rtf", &Test::testFdo67498}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1370,6 +1372,12 @@ void Test::testFdo67365() CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_LEFT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraphOfText(1, xCell->getText()), "ParaAdjust"))); } +void Test::testFdo67498() +{ + // Left margin of the default page style wasn't set (was 2000). + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(5954)), getProperty<sal_Int32>(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "LeftMargin")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |