summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-01-18 20:51:26 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-01-19 09:02:07 +0100
commit3303a4c5f21874453e634d84408c50e7a0055a4d (patch)
tree2f13199b2976836d3b61448f0beb9ba6eddceba6 /writerfilter/source/dmapper
parent474398937b5d53d5c7ab30a877f8b663e6963b02 (diff)
tdf#135153 DOCX import: avoid line-of-text relation with to-para anchoring
Regression from commit 8f1a1092d47947847e1d888b0284e8364c663d1f (tdf#97371 DOCX import: fix text covered by shape, 2016-01-28), the problem was that once the import decides that a shape should have no to-char anchoring, it should not leave behind vertical relation types which make no sense for to-para anchoring. text::RelOrientation::TEXT_LINE is specific to to-char anchoring, so reset the relation back to the default text::RelOrientation::FRAME. This means we'll no longer show "from top" on the UI while the doc model contains "from bottom": and those have to be in sync, otherwise pressing "down" while the shape is selected will actually move it up. Change-Id: I660a7bb30133ea866cc4ba1620ae15fea243ef8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109570 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 02c348a05693..cc81850bfc86 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -872,6 +872,14 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
eAnchorType = text::TextContentAnchorType_AT_CHARACTER;
xShapeProps->setPropertyValue("AnchorType", uno::makeAny(eAnchorType));
+
+ if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE && bTextBox)
+ {
+ // TEXT_LINE to specific to to-char anchoring, we have to-para, so reset
+ // to default.
+ m_pImpl->nVertRelation = text::RelOrientation::FRAME;
+ }
+
if (m_pImpl->bLayoutInCell && bTextBox && m_pImpl->rDomainMapper.IsInTable()
&& m_pImpl->nHoriRelation == text::RelOrientation::PAGE_FRAME)
m_pImpl->nHoriRelation = text::RelOrientation::FRAME;