diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-15 09:19:45 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-11-23 11:26:56 +0000 |
commit | d36587570890d3366222fc9cca8482275db85b3b (patch) | |
tree | cb5703049c957126e2fc4a6b3aedf25957f2a695 /writerfilter | |
parent | eeb923d59cf24876517c5976edad9d803df63857 (diff) |
tdf#82824 DOCX import: fix at-char embedded object handling
The anchor type of embedded object was simply not handled, we always
assumed that it's as-char.
When it's at-char set the anchor type accordingly, and also set the
usual 6 properties determining the position of the anchored object.
(cherry picked from commit 10efab2b9a3cf7fc49655c90ba29db4512680c38)
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Change-Id: I3f8bede33c6f1a0bdc4f4d4ea59c4fc805802291
Reviewed-on: https://gerrit.libreoffice.org/30965
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 08de96efd1f9..855c131d2ab3 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4766,7 +4766,21 @@ void DomainMapper_Impl::ImportGraphic(const writerfilter::Reference< Properties // Update the shape properties if it is embedded object. if(m_xEmbedded.is()){ - UpdateEmbeddedShapeProps(m_pGraphicImport->GetXShapeObject()); + uno::Reference<drawing::XShape> xShape = m_pGraphicImport->GetXShapeObject(); + UpdateEmbeddedShapeProps(xShape); + if (eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR) + { + uno::Reference<beans::XPropertySet> xEmbeddedProps(m_xEmbedded, uno::UNO_QUERY); + text::TextContentAnchorType eAnchorType = text::TextContentAnchorType_AT_CHARACTER; + xEmbeddedProps->setPropertyValue("AnchorType", uno::makeAny(eAnchorType)); + uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); + xEmbeddedProps->setPropertyValue("HoriOrient", xShapeProps->getPropertyValue("HoriOrient")); + xEmbeddedProps->setPropertyValue("HoriOrientPosition", xShapeProps->getPropertyValue("HoriOrientPosition")); + xEmbeddedProps->setPropertyValue("HoriOrientRelation", xShapeProps->getPropertyValue("HoriOrientRelation")); + xEmbeddedProps->setPropertyValue("VertOrient", xShapeProps->getPropertyValue("VertOrient")); + xEmbeddedProps->setPropertyValue("VertOrientPosition", xShapeProps->getPropertyValue("VertOrientPosition")); + xEmbeddedProps->setPropertyValue("VertOrientRelation", xShapeProps->getPropertyValue("VertOrientRelation")); + } } //insert it into the document at the current cursor position OSL_ENSURE( xTextContent.is(), "DomainMapper_Impl::ImportGraphic"); |