[Libreoffice-commits] core.git: sw/qa writerfilter/source
Tibor Nagy (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 10 08:28:29 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf133457.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 9 +++++++++
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 17 ++++++++++++++---
3 files changed, 23 insertions(+), 3 deletions(-)
New commits:
commit 6c14c87cad6a3c38d7e597932ec591f4bc610be8
Author: Tibor Nagy <nagy.tibor2 at nisz.hu>
AuthorDate: Thu May 28 13:47:30 2020 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Wed Jun 10 10:27:53 2020 +0200
tdf#133457 DOCX import: fix frame position regression
caused by commit f5636817e7677a3081263df9004940a7d5ac54af
(tdf#112287 DOCX frame import: fix default vAnchor).
Co-authored-by: Attila Bakos (NISZ)
Change-Id: I6fe16ff274d6a2fa4a335c7790ecd0f01641a6fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95035
Tested-by: Jenkins
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/tdf133457.docx b/sw/qa/extras/ooxmlexport/data/tdf133457.docx
new file mode 100644
index 000000000000..8fb6730b0933
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf133457.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 9e0d318f1021..877594f9f2f2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -961,6 +961,15 @@ DECLARE_OOXMLIMPORT_TEST(testTdf107119, "tdf107119.docx")
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(XPropsWrap, "Surround"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf133457, "tdf133457.docx")
+{
+ xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+ if (!pXmlDocument)
+ return;
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:pPr/w:framePr","vAnchor","text");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index e06c98145b23..557b09fa5917 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1167,10 +1167,21 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
pStyleProperties->IsyValid() ? pStyleProperties->Gety() : DEFAULT_VALUE));
//Default the anchor in case FramePr_vAnchor is missing ECMA 17.3.1.11
- aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_RELATION), sal_Int16(
- rAppendContext.pLastParagraphProperties->GetvAnchor() >= 0 ?
+ if (rAppendContext.pLastParagraphProperties->GetWrap() == text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE &&
+ pStyleProperties->GetWrap() == text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE)
+ {
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_RELATION), sal_Int16(
+ rAppendContext.pLastParagraphProperties->GetvAnchor() >= 0 ?
+ rAppendContext.pLastParagraphProperties->GetvAnchor() :
+ pStyleProperties->GetvAnchor() >= 0 ? pStyleProperties->GetvAnchor() : text::RelOrientation::FRAME)));
+ }
+ else
+ {
+ aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_RELATION), sal_Int16(
+ rAppendContext.pLastParagraphProperties->GetvAnchor() >= 0 ?
rAppendContext.pLastParagraphProperties->GetvAnchor() :
- pStyleProperties->GetvAnchor() >= 0 ? pStyleProperties->GetvAnchor() : text::RelOrientation::PAGE_PRINT_AREA )));
+ pStyleProperties->GetvAnchor() >= 0 ? pStyleProperties->GetvAnchor() : text::RelOrientation::PAGE_PRINT_AREA)));
+ }
aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SURROUND),
rAppendContext.pLastParagraphProperties->GetWrap() != text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE
More information about the Libreoffice-commits
mailing list