[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa writerfilter/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 28 09:43:08 UTC 2020


 sw/qa/extras/ooxmlexport/data/tdf115719.docx  |binary
 sw/qa/extras/ooxmlexport/data/tdf115719b.docx |binary
 sw/qa/extras/ooxmlimport/data/tdf115719b.docx |binary
 writerfilter/source/dmapper/PropertyMap.cxx   |   22 ++++++++++++++++++++++
 4 files changed, 22 insertions(+)

New commits:
commit 5a9e5b3d297094fc014f37d0d3843be82b2f4706
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Apr 20 21:04:30 2020 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue Apr 28 11:42:36 2020 +0200

    tdf#131446 DOCX import: restrict IncreasedAnchoredObjectSpacing further
    
    Regression from commit 8b73bafbc18acb4dd8911d2f2de8158d98eb6144
    (tdf#115719 DOCX import: increase paragraph spacing for anchored
    objects, 2018-02-14), this is another case where the workaround for the
    Word layout bug is not needed.
    
    tdf115719.docx and tdf115719b.docx are tweaked to have <wp:anchor ...
    behindDoc="1"> for 1 shape, as the original bugdoc has it. This allows
    us to render both the tdf#115719 and tdf#131446 bug documents the same
    way as Word does.
    
    (cherry picked from commit 249428202be04ab9a2271a9cd48922523fa03bc4)
    
    Change-Id: I0c3f197c3360882cd64f8dcf286c6051dc11d674
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92978
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf115719.docx b/sw/qa/extras/ooxmlexport/data/tdf115719.docx
index 4eda09a98fa2..99806d4dc860 100644
Binary files a/sw/qa/extras/ooxmlexport/data/tdf115719.docx and b/sw/qa/extras/ooxmlexport/data/tdf115719.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf115719b.docx b/sw/qa/extras/ooxmlexport/data/tdf115719b.docx
index a632e3df0e7a..f3e3925c8869 100644
Binary files a/sw/qa/extras/ooxmlexport/data/tdf115719b.docx and b/sw/qa/extras/ooxmlexport/data/tdf115719b.docx differ
diff --git a/sw/qa/extras/ooxmlimport/data/tdf115719b.docx b/sw/qa/extras/ooxmlimport/data/tdf115719b.docx
index 4cb13228443a..7d91108bc0bd 100644
Binary files a/sw/qa/extras/ooxmlimport/data/tdf115719b.docx and b/sw/qa/extras/ooxmlimport/data/tdf115719b.docx differ
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index d83d2bd831dd..fbc471415b4c 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1233,6 +1233,28 @@ void SectionPropertyMap::HandleIncreasedAnchoredObjectSpacing(DomainMapper_Impl&
         if (rAnchor.m_aAnchoredObjects.size() < 4)
             continue;
 
+        // Ignore this paragraph if none of the objects are wrapped in the background.
+        sal_Int32 nOpaqueCount = 0;
+        for (const auto& rAnchored : rAnchor.m_aAnchoredObjects)
+        {
+            uno::Reference<beans::XPropertySet> xShape(rAnchored.m_xAnchoredObject, uno::UNO_QUERY);
+            if (!xShape.is())
+            {
+                continue;
+            }
+
+            bool bOpaque = true;
+            xShape->getPropertyValue("Opaque") >>= bOpaque;
+            if (!bOpaque)
+            {
+                ++nOpaqueCount;
+            }
+        }
+        if (nOpaqueCount < 1)
+        {
+            continue;
+        }
+
         // Analyze the anchored objects of this paragraph, now that we know the
         // page width.
         sal_Int32 nShapesWidth = 0;


More information about the Libreoffice-commits mailing list