summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-26 21:52:05 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2018-05-07 12:38:20 +0200
commit90d298ba863210ac2ad140c7bf8e426fc39b10ca (patch)
tree0267c8e85770f76246e41bda7683e39e1f96df91 /writerfilter
parentc929028b9eba570a32d2a8ce8cf0c153de8f2f19 (diff)
tdf#116410 DOCX import: restrict increased object spacing to multiple shapes
This anchored object handling is just there to be bug-compatible with Word, it's not needed for the case when there is a single shape in the paragraph. (cherry picked from commit 2c4d84e93901571ead79c85aa3894ef4e10bf5af) Also: Related: tdf#115719 DOCX import: fix ignore of increased anchored obj spacing If there is only a single anchored object, then ignore only the current paragraph, not all paragraphs of the section. (cherry picked from commit 599ff05300599d4e4ce818092f18e76e738b921e) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: I5e3dc4ba9a4a6f459ec6217e8974ebc2d7303bcc Reviewed-on: https://gerrit.libreoffice.org/52981 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 82f6da65acaf02bc3b9d6b2039a4c307d5593423) Reviewed-on: https://gerrit.libreoffice.org/53738 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index c00e4bfec593..8c87c2c91286 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1135,6 +1135,10 @@ void SectionPropertyMap::HandleIncreasedAnchoredObjectSpacing(DomainMapper_Impl&
std::vector<AnchoredObjectInfo>& rAnchoredObjectAnchors = rDM_Impl.m_aAnchoredObjectAnchors;
for (auto& rAnchor : rAnchoredObjectAnchors)
{
+ // Ignore this paragraph when there is a single shape only.
+ if (rAnchor.m_aAnchoredObjects.size() < 2)
+ continue;
+
// Analyze the anchored objects of this paragraph, now that we know the
// page width.
sal_Int32 nShapesWidth = 0;