summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-06-05 09:43:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-06-05 14:26:02 +0200
commit09a37fe50f36ced755bc326fb6b4c1b6fdf61f86 (patch)
tree68a1d37ffa51d46e94568a6e429827939d5fd623
parent9c7372392793463babc31dc3de51af9be828aa8e (diff)
tdf#117843 DOCX import: disable compat increased spacing in header/footer
It's only relevant for the body text. Change-Id: Id894604ed9b2c19400eeabbd2966f104d8b34aab Reviewed-on: https://gerrit.libreoffice.org/55311 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf117843.docxbin0 -> 26926 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx12
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx4
3 files changed, 15 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf117843.docx b/sw/qa/extras/ooxmlimport/data/tdf117843.docx
new file mode 100644
index 000000000000..501e85bfef96
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf117843.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index f01b0bfe37e3..bea30cf86716 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -151,6 +151,18 @@ DECLARE_OOXMLIMPORT_TEST(testTdf111550, "tdf111550.docx")
getCell(innerTable, "A1", "[outer:A2]\n[inner:A1]");
}
+DECLARE_OOXMLIMPORT_TEST(testTdf117843, "tdf117843.docx")
+{
+ uno::Reference<container::XNameAccess> xPageStyles = getStyles("PageStyles");
+ uno::Reference<style::XStyle> xPageStyle(xPageStyles->getByName("Standard"), uno::UNO_QUERY);
+ uno::Reference<text::XText> xHeaderText
+ = getProperty<uno::Reference<text::XText>>(xPageStyle, "HeaderText");
+ // This was 4025, increased top paragraph margin was unexpected.
+ CPPUNIT_ASSERT_EQUAL(
+ static_cast<sal_Int32>(0),
+ getProperty<sal_Int32>(getParagraphOfText(1, xHeaderText), "ParaTopMargin"));
+}
+
DECLARE_OOXMLIMPORT_TEST(testTdf43017, "tdf43017.docx")
{
uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f84f37536f93..6521a08d0445 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1349,9 +1349,11 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap )
xTextRange = xTextAppend->finishParagraph( comphelper::containerToSequence(aProperties) );
m_xPreviousParagraph.set(xTextRange, uno::UNO_QUERY);
- if (!rAppendContext.m_aAnchoredObjects.empty())
+ if (!rAppendContext.m_aAnchoredObjects.empty() && !IsInHeaderFooter())
{
// Remember what objects are anchored to this paragraph.
+ // That list is only used for Word compat purposes, and
+ // it is only relevant for body text.
AnchoredObjectInfo aInfo;
aInfo.m_xParagraph = xTextRange;
aInfo.m_aAnchoredObjects = rAppendContext.m_aAnchoredObjects;