summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-26 21:52:05 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-27 09:17:38 +0200
commit2c4d84e93901571ead79c85aa3894ef4e10bf5af (patch)
treeb20100cc0f8220217db316325e9a3d68b4f4ef5a /writerfilter
parent0518bb5c3a98d973c3675fdd4cb8c52a669a3507 (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. Change-Id: I5e3dc4ba9a4a6f459ec6217e8974ebc2d7303bcc Reviewed-on: https://gerrit.libreoffice.org/51922 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
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 76851c428438..bf3522008f63 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1146,6 +1146,10 @@ void SectionPropertyMap::HandleIncreasedAnchoredObjectSpacing(DomainMapper_Impl&
std::vector<AnchoredObjectInfo>& rAnchoredObjectAnchors = rDM_Impl.m_aAnchoredObjectAnchors;
for (auto& rAnchor : rAnchoredObjectAnchors)
{
+ // Ignore the case when there is a single shape only.
+ if (rAnchor.m_aAnchoredObjects.size() < 2)
+ return;
+
// Analyze the anchored objects of this paragraph, now that we know the
// page width.
sal_Int32 nShapesWidth = 0;