diff options
author | Bakos Attila <bakos.attilakaroly@nisz.hu> | 2020-01-10 10:49:14 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-01-10 16:17:15 +0100 |
commit | ba18069e9708f60452f7b5f2306b407780dd898d (patch) | |
tree | 5ad1656ce3e7fcc34cc0678bab0a1fc56966e115 /writerfilter | |
parent | ca54ad87c4fffe52f282fa4cba84952e6888cb62 (diff) |
tdf#128207: DOCX import: fix chart positioning
Embedded graphic objects had got 0 values for vertical and horizontal
positioning before, resulting overlapping, hidden charts,
but now they are positioned according to the values in the document.
(cherry picked from commit d9c535ead688e9f156dbcf43948df08a69e218be)
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
[ Miklos: reworked the testcase to use the UNO API, the other way would
only work on master. ]
Change-Id: Ia5403ac65ff7192d61072e8a9d8a7f80c7178b9b
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.hxx | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f17a52da1697..d5fbaa9f2af6 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -5146,6 +5146,10 @@ void DomainMapper_Impl::ImportGraphic(const writerfilter::Reference< Properties // Update the shape properties if it is embedded object. if(m_xEmbedded.is()){ + if (m_pGraphicImport->GetXShapeObject()) + m_pGraphicImport->GetXShapeObject()->setPosition( + m_pGraphicImport->GetGraphicObjectPosition()); + uno::Reference<drawing::XShape> xShape = m_pGraphicImport->GetXShapeObject(); UpdateEmbeddedShapeProps(xShape); if (eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR) diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 6830e9db71b1..76f36045ea4e 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -423,6 +423,11 @@ GraphicImport::~GraphicImport() { } +com::sun::star::awt::Point GraphicImport::GetGraphicObjectPosition() +{ + return (com::sun::star::awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition)); +} + void GraphicImport::handleWrapTextValue(sal_uInt32 nVal) { switch (nVal) diff --git a/writerfilter/source/dmapper/GraphicImport.hxx b/writerfilter/source/dmapper/GraphicImport.hxx index f513632e966b..c2dc01a51317 100644 --- a/writerfilter/source/dmapper/GraphicImport.hxx +++ b/writerfilter/source/dmapper/GraphicImport.hxx @@ -94,6 +94,8 @@ public: const css::uno::Reference<css::drawing::XShape>& GetXShapeObject() { return m_xShape;} bool IsGraphic() const; + com::sun::star::awt::Point GetGraphicObjectPosition(); + private: // Properties virtual void lcl_attribute(Id Name, Value & val) override; |