summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-06-05 09:43:49 +0200
committerAron Budea <aron.budea@collabora.com>2018-06-25 18:26:31 +0200
commit6dcf475d5cda984ce0d1035e36267cedc3019e50 (patch)
treeb56bc4f17cecf85712f0a20c2f8f5110214bce0f
parent08f77bc1c6650ee7b2dd9d7825bbc1cf08d4761b (diff)
tdf#117843 DOCX import: disable compat increased spacing in header/footer
It's only relevant for the body text. (cherry picked from commit 09a37fe50f36ced755bc326fb6b4c1b6fdf61f86) Reviewed-on: https://gerrit.libreoffice.org/55335 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit eb65a8c54f56abc8ba66f9cbc779cd20e4740933) Change-Id: Id894604ed9b2c19400eeabbd2966f104d8b34aab Reviewed-on: https://gerrit.libreoffice.org/56053 Tested-by: Jenkins Reviewed-by: Aron Budea <aron.budea@collabora.com>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf117843.docxbin0 -> 26926 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.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/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 22bf0b01f752..e6f3a150b31f 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1608,6 +1608,18 @@ DECLARE_OOXMLIMPORT_TEST(testTdf116486, "tdf116486.docx")
CPPUNIT_ASSERT_EQUAL( OUString("4006"), aTop );
}
+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"));
+}
+
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b5ec69a98304..f65d2166cc01 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1258,9 +1258,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;