summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2020-05-20 13:31:51 +0200
committerLászló Németh <nemeth@numbertext.org>2020-05-25 10:12:44 +0200
commit358f654af36fa12102685237f6eadebae4610fb5 (patch)
tree4a5b406b97d24bfba866d469a6cf436fc9455ff6
parent956529cc28a5710ff6ea4e46dbe635fae64c4eb5 (diff)
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@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf107119.docxbin0 -> 12207 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport6.cxx7
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx5
3 files changed, 10 insertions, 2 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf107119.docx
Binary files 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