diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-05-15 12:51:29 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2020-05-25 06:43:33 +0200 |
commit | 50b76d9bf3747e1b5bcb6ce189337872db379e45 (patch) | |
tree | b9894ff99955a22db9ed5e6f16e7f3d59dfa1c94 /sw | |
parent | 21875558f6c478f07d68ff39e025d7ffd451674f (diff) |
tdf#133000 writerfilter: apply non-contradictory num-style
This fixes 7.0 regression exposed by tdf#131321's
commit 35fc5ef0a759884b24ed8b83cd05702a0fab64cc
This patch version heavily depends on recent changes,
but could easily be adapted to older ways.
(See previous versions in gerrit.)
Because LO can now find the numbering rule through
the para-style definition, it doesn't bother creating it
as a direct paragraph property anymore.
So that "directness" has to be specified during the import.
This problem manifested itself in two ways.
1.) In SW, the direct numbering was lost and it simply
inherits from the para-style. If numbering is now turned off
in the para-style, then the paragraph loses it too.
2.) Because the numbering was considered to be
defined by the paragraph style, the para-style-indents
had higher priority than the numbering-indents.
When numbering is defined directly on the paragraph,
it has higher priority than the para-style-indents.
Change-Id: I04c3944de8a91d9f253791fbd05d6324a8b7a9da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94365
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf133000_numStyleFormatting.docx | bin | 0 -> 13761 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf133000_numStyleFormatting.docx b/sw/qa/extras/ooxmlexport/data/tdf133000_numStyleFormatting.docx Binary files differnew file mode 100644 index 000000000000..567f38265cb3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133000_numStyleFormatting.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index e57100bafd47..60725f041b32 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -204,6 +204,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf87569v, "tdf87569_vml.docx") true, bValue); } +DECLARE_OOXMLEXPORT_TEST(testTdf133000_numStyleFormatting, "tdf133000_numStyleFormatting.docx") +{ + // Paragraph style's LeftMargin should not override numbering's Left Margin + xmlDocUniquePtr pDump = parseLayoutDump(); + assertXPathContent(pDump, "/root/page[1]/body/txt[2]", "First line"); + const sal_Int32 nLevel1Margin = getXPath(pDump, "//page[1]/body/txt[2]/infos/prtBounds", "left").toInt32(); + assertXPathContent(pDump, "/root/page[1]/body/txt[4]", "One sublevel"); + const sal_Int32 nLevel2Margin = getXPath(pDump, "//page[1]/body/txt[4]/infos/prtBounds", "left").toInt32(); + CPPUNIT_ASSERT( nLevel1Margin < nLevel2Margin ); +} + DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.docx") { auto xNumberingRules |