summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2020-05-28 13:47:30 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-06-12 18:39:54 +0200
commit067f7548f4e4cebcfcbc38457201d1c112ad80c3 (patch)
treeb32ceb17ac0d2d9f786ec8dbf150991bd1d9efeb /writerfilter
parent9e746242a5dc4fd79ed8214c5508bade60d325ca (diff)
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@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 5e8761ef902a8d5d6534b7c1803242bacff72be3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95977 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index abde5e06db47..7476f7d1ee56 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