summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-09-20 19:56:37 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-09-21 08:18:40 +0200
commit7246e57216bb20c15af0ecf6a0183f5ffa81e780 (patch)
treeb69ab1799e3cf7188de2da89b895d907a726c3be /writerfilter/source
parentf5a81a119cb63152c2c2e2473a1ea183a30c8db9 (diff)
tdf#143591 DOCX import: handle anchored objects as at-char
This partially reverts cc8f8ae55f681755f5da3bf64e4c30bb713f0383 (DOCX drawingML shape import: wp:anchor's behindDoc attribute, 2013-11-19), it seems to be more important to be consistent with the DOC import than with the VML import which is no longer used for DOCX shapes crated with Word >= 2010. Change-Id: I631da010bce1b4d3c392645e0ae3797a03665a42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122367 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 3fc0b044a392..e0a2828b5606 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1227,8 +1227,8 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
// But they aren't Writer pictures, either (which are already handled above).
uno::Reference< beans::XPropertySet > xShapeProps(m_xShape, uno::UNO_QUERY_THROW);
- // This needs to be AT_PARAGRAPH by default and not AT_CHARACTER, otherwise shape will move when the user inserts a new paragraph.
- text::TextContentAnchorType eAnchorType = text::TextContentAnchorType_AT_PARAGRAPH;
+ // Anchored: Word only supports at-char in that case.
+ text::TextContentAnchorType eAnchorType = text::TextContentAnchorType_AT_CHARACTER;
if (m_pImpl->bHidden)
{
@@ -1248,9 +1248,6 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
if (m_pImpl->bLayoutInCell && bTextBox)
m_pImpl->bLayoutInCell = !m_pImpl->bCompatForcedLayoutInCell;
- if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE)
- eAnchorType = text::TextContentAnchorType_AT_CHARACTER;
-
xShapeProps->setPropertyValue("AnchorType", uno::makeAny(eAnchorType));
if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE)