[Libreoffice-commits] core.git: sw/qa writerfilter/source

Tibor Nagy (via logerrit) logerrit at kemper.freedesktop.org
Mon May 25 08:13:26 UTC 2020


 sw/qa/extras/ooxmlexport/data/tdf107119.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx    |    7 +++++++
 writerfilter/source/dmapper/DomainMapper.cxx |    5 +++--
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 358f654af36fa12102685237f6eadebae4610fb5
Author:     Tibor Nagy <nagy.tibor2 at nisz.hu>
AuthorDate: Wed May 20 13:31:51 2020 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Mon May 25 10:12:44 2020 +0200

    tdf#107119 DOCX import: fix parallel text wrap around frames
    
    It was imported as "optimal page wrap" instead of parallel one,
    resulting different page layout depending on the distance
    of the frame object from the page margins.
    
    Co-authored-by: Attila Bakos (NISZ)
    
    Change-Id: I0db65c224f537bfd4f95ee073743a3d17d9e0e4d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94576
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf107119.docx b/sw/qa/extras/ooxmlexport/data/tdf107119.docx
new file mode 100644
index 000000000000..98de4f2ac7bd
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf107119.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 9a453ac89553..9e0d318f1021 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/style/LineSpacingMode.hpp>
 #include <com/sun/star/text/GraphicCrop.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
 
 #include <comphelper/sequenceashashmap.hxx>
 
@@ -954,6 +955,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSyncedRelativePercent, "tdf93676-1.odt")
     assertXPath(pXmlDoc, "//wp14:pctHeight", 0);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf107119, "tdf107119.docx")
+{
+    uno::Reference<beans::XPropertySet> XPropsWrap(getShape(1), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(XPropsWrap, "Surround"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 539114928bd3..77abe842d695 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -879,10 +879,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                                     sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_none ||
                                     sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_auto,
                             "wrap not around, not_Beside, through, none or auto?");
-                        if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_around ||
-                            sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_through ||
+                        if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_through ||
                             sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_auto )
                             pParaProperties->SetWrap ( text::WrapTextMode_DYNAMIC ) ;
+                        else if (sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_around)
+                            pParaProperties->SetWrap(text::WrapTextMode_PARALLEL);
                         else if (sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_doc_ST_Wrap_none)
                             pParaProperties->SetWrap ( text::WrapTextMode_THROUGH ) ;
                         else


More information about the Libreoffice-commits mailing list