sw/qa/extras/ooxmlexport/data/tdf115719.docx  |binary
 sw/qa/extras/ooxmlexport/data/tdf123243.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx    |    7 +++++++
 sw/qa/extras/ooxmlimport/data/tdf115719b.docx |binary
 writerfilter/source/dmapper/PropertyMap.cxx   |    5 +++--
 5 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit f12f26e798b4251a0acc6af21a49150f7a13ad86
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Mar 4 21:24:58 2019 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Mar 11 10:18:41 2019 +0100

    tdf#123243 DOCX import: make increased anchored obj spacing cond more strict
    
    Regression from commit 8b73bafbc18acb4dd8911d2f2de8158d98eb6144
    (tdf#115719 DOCX import: increase paragraph spacing for anchored
    objects, 2018-02-14), which is an import-time workaround for a Word
    layout bug.
    
    Re-checking the original document from that bug, this only happens with
    more anchored shapes (to the same paragraph), so make the workaround
    condition more strict, fixing the layout of this bugdoc.
    
    (Which means tdf115719.docx and tdf115719b.docx are modified to be more
    close to the original bugdoc.)
    
    Just checked, sadly Word's layout bug is still there in MSO 2019, so
    can't revert our emulation of it (not yet).
    
    (cherry picked from commit fa10258d723a0c50941166ba13274308fb0cfcbe)
    
    Change-Id: I26f74a497b7718f8f3a2eadac481c8722e85e680
    Reviewed-on: https://gerrit.libreoffice.org/68884
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf115719.docx 
b/sw/qa/extras/ooxmlexport/data/tdf115719.docx
index 9519a2a14524..f98f8b4a05dc 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/tdf123243.docx 
b/sw/qa/extras/ooxmlexport/data/tdf123243.docx
new file mode 100644
index 000000000000..9519a2a14524
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf123243.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 7874762db678..51d847229698 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -292,6 +292,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf115719, "tdf115719.docx")
     CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf123243, "tdf123243.docx")
+{
+    // Without the accompanying fix in place, this test would have failed with 
'Expected: 1; Actual:
+    // 2'; i.e. unexpected paragraph margin created 2 pages.
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf116410, "tdf116410.docx")
 {
     // Opposite of the above, was 2 pages, should be 1 page.
diff --git a/sw/qa/extras/ooxmlimport/data/tdf115719b.docx 
b/sw/qa/extras/ooxmlimport/data/tdf115719b.docx
index 551b9871fe60..8c552baf76c1 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 b52d1da6c253..e965db4f919b 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1242,8 +1242,9 @@ 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)
+        // Ignore this paragraph when there are not enough shapes to trigger 
the Word bug we
+        // emulate.
+        if (rAnchor.m_aAnchoredObjects.size() < 4)
             continue;
 
         // Analyze the anchored objects of this paragraph, now that we know the
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to