[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Oct 18 08:57:54 UTC 2016
sw/qa/extras/ooxmlexport/data/tdf95031.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 6 ++++++
writerfilter/source/dmapper/DomainMapper.cxx | 6 ++++++
3 files changed, 12 insertions(+)
New commits:
commit c486e875de7c8e845594f5043a37ee8800865782
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Oct 18 09:19:50 2016 +0200
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.
Change-Id: I9499bfa4d8d7fcc425d7b95e64987258c099f7f2
Reviewed-on: https://gerrit.libreoffice.org/29989
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf95031.docx b/sw/qa/extras/ooxmlexport/data/tdf95031.docx
new file mode 100644
index 0000000..ef082f7
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf95031.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 31c9b9f..0a63788 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -39,6 +39,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92045, "tdf92045.docx")
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getRun(getParagraph(1), 1), "CharFlash"));
}
+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"));
+}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 1933b42..b93a965 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
More information about the Libreoffice-commits
mailing list