diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-04-04 09:12:34 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-04-04 10:05:02 +0000 |
commit | 1bf7f6a1a50ee9f24a3687240fe6ae390b905a6b (patch) | |
tree | ba7c467f684dbdc861ae436cfd9f1bbd0418933a /sw/qa | |
parent | f1e2c030b09d25a285d6a206297f0ef7526ccc4a (diff) |
tdf#106690 DOCX import: fix automatic spacing before/after numbered para block
The context is text nodes with automatic before/after spacing and
numbering rules set, like:
A
* B
* C
* D
E
The correct behavior seems to be (though I haven't found this explicitly
written in the OOXML spec) to drop spacing between B and C and C and D,
but not before B and not after D. Originally no spacing was dropped,
then commit c486e875de7c8e845594f5043a37ee8800865782 (tdf#95031 DOCX
import: auto spacing inside numbering means no spacing, 2016-10-18)
removed spacing around all B/C/D.
Fix the problem by checking the numbering rules and automatic after
spacing of the previous paragraph, so spacing before B and after D is
not removed.
Change-Id: Icbdb36e31057ab0e8ac033888cf5cc7c52dad5d0
Reviewed-on: https://gerrit.libreoffice.org/36062
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf106690.docx | bin | 0 -> 20653 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 9 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf106690.docx b/sw/qa/extras/ooxmlexport/data/tdf106690.docx Binary files differnew file mode 100644 index 000000000000..b233ef81c6cf --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf106690.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index e7bc9cbb03ff..178c71b6fcc0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -61,6 +61,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95031, "tdf95031.docx") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin")); } +DECLARE_OOXMLEXPORT_TEST(testTdf106690, "tdf106690.docx") +{ + // This was 0, numbering rules with automatic spacing meant 0 + // before/autospacing for all text nodes, even for ones at the start/end of + // a numbered text node block. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(2), "ParaTopMargin")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf89377, "tdf89377_tableWithBreakBeforeParaStyle.docx") { // the paragraph style should set table's text-flow break-before-page |