diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-04-04 09:12:34 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-04-12 17:24:44 +0200 |
commit | e227b6fe086b2caf30ca489f4d74a9f9a725c635 (patch) | |
tree | 67909d65cf3ac7d32638e983606b3f44be609047 /sw | |
parent | 0cffb61df73abba1e5c810a5ba604d32476247e3 (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>
(cherry picked from commit 1bf7f6a1a50ee9f24a3687240fe6ae390b905a6b)
Reviewed-on: https://gerrit.libreoffice.org/36142
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit 776839b8bfc6eed905ce97c6fe32af8deb8d1451)
Diffstat (limited to 'sw')
-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 786074a40849..e48f51824749 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -49,6 +49,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 |