diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-10-18 09:19:50 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-11-03 21:29:41 +0000 |
commit | 806e323271982c8975ec2904219c6f136aa20eea (patch) | |
tree | d95bb8bbe2a5da95f9b034d5245047177d6eadf2 | |
parent | cd998b587f9956c1f4292d4db3200cc6c9320001 (diff) |
tdf#95031 DOCX import: auto spacing inside numbering means no spacing
The WW8 import has code for this in SwWW8ImplReader::AppendTextNode(),
with lots of corner-cases. Not all of that is implemented here yet, but
the bullet list in the bugdoc already looks correct now.
(cherry picked from commit c486e875de7c8e845594f5043a37ee8800865782)
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
Change-Id: I9499bfa4d8d7fcc425d7b95e64987258c099f7f2
Reviewed-on: https://gerrit.libreoffice.org/30291
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf95031.docx | bin | 0 -> 14024 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 6 |
3 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf95031.docx b/sw/qa/extras/ooxmlexport/data/tdf95031.docx Binary files differnew file mode 100644 index 000000000000..ef082f752038 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf95031.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 42f647430f74..0e81597c0cd3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -1137,6 +1137,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect"); } +DECLARE_OOXMLEXPORT_TEST(testTdf95031, "tdf95031.docx") +{ + // This was 494, in-numbering paragraph's automating spacing was handled as visible spacing, while it should not. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index af0ae0af3235..c39208b7c619 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -613,6 +613,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) } if (nIntValue) // If auto spacing is set, then only store set value in InteropGrabBag { + if (m_pImpl->GetTopContext()->isSet(PROP_NUMBERING_RULES)) + // Numbering is set -> auto space is 0. + default_spacing = 0; m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ) ); } else @@ -635,6 +638,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) } if (nIntValue) // If auto spacing is set, then only store set value in InteropGrabBag { + if (m_pImpl->GetTopContext()->isSet(PROP_NUMBERING_RULES)) + // Numbering is set -> auto space is 0. + default_spacing = 0; m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ) ); } else |