diff options
author | Justin Luth <justin_luth@sil.org> | 2018-07-24 14:49:00 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-05-18 12:36:50 +0200 |
commit | e38e5d788c2f1e8b9ba90abc7ae9623bb8539f31 (patch) | |
tree | baa06ae3297ea2d861bbac6e21a436b9635deea1 /sw | |
parent | 760c5f4066f2651ca8b4d4e0597e7b01062fcc5a (diff) |
tdf#118521 writerfilter: ContextMargin grouped with Top/Bottom
fixes tdf#104348, but tagging with the bug# of the initial fixes.
Internally, EditEng holds Top/Bottom/Context settings in one
object, so if only one piece is set, the cloned object
starts with docDefaults, so the un-initialized parts also need to
be specified with the values they inherit from their style.
So this patch makes two corrections. The first is grouping
ContextMargin with top/bottom. The second correction
is to check the entire style-chain instead of only
the direct style for the inherited property.
Change-Id: Ie1d4c9538aefece4ff8b7287242c7f4d33319b3b
Reviewed-on: https://gerrit.libreoffice.org/57914
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 07266e2314fd19dcbf777dadd52d7b826b23c207)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf104348_contextMargin.docx | bin | 0 -> 19145 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf104348_contextMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf104348_contextMargin.docx Binary files differnew file mode 100644 index 000000000000..ef3d06533bb7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf104348_contextMargin.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 3159a14c7953..8ac0df32ebf3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -462,6 +462,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117504_numberingIndent, "tdf117504_numberingInde CPPUNIT_ASSERT_MESSAGE("Paragraph has numbering style", !sName.isEmpty()); } +DECLARE_OOXMLEXPORT_TEST(testTdf104348_contextMargin, "tdf104348_contextMargin.docx") +{ + // tdf#104348 shows that ContextMargin belongs with Top/Bottom handling + + uno::Reference<beans::XPropertySet> xMyStyle(getStyles("ParagraphStyles")->getByName("MyStyle"), uno::UNO_QUERY); + // from paragraph style - this is what direct formatting should equal + sal_Int32 nMargin = getProperty<sal_Int32>(xMyStyle, "ParaBottomMargin"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nMargin); + // from direct formatting + CPPUNIT_ASSERT_EQUAL(nMargin, getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf118521_marginsLR, "tdf118521_marginsLR.docx") { // tdf#118521 paragraphs with direct formatting of only some of left, right, or first margins have |