diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-21 12:08:00 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-21 15:02:11 +0100 |
commit | 3aef7b3b3dba2d898f3a278e916166e7c3d87321 (patch) | |
tree | 13d8ec6c33a5d4e14db5623f4e755f7980f93505 /oox | |
parent | cdfebf30946307998eb3965ad30bbcd34ce82b02 (diff) |
drawingML export: fix position of wrapped shapes in DOCX
In case of DOCX, the DOCX wrapper around the drawingML fragment already
contains the real position of the shape (which talks about paragraphs
and other concepts which are unavailable in a spreadsheet /
presentation), and the inner position should be 0, otherwise the shape
is shifted towards the bottom right corner.
Note that this only affects drawinglayer shapes in DOCX, Writer pictures
are handled in sw, and those always had a 0,0 position in the inner
drawingML fragment.
Change-Id: I582b1ae64387b50ffb051e1f5017eab0e5d5ab34
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 2cddbf50ec4d..f81cd9195edb 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -714,7 +714,15 @@ void DrawingML::WriteTransformation( const Rectangle& rRect, XML_rot, (nRotation % 21600000) ? I32S( nRotation ) : NULL, FSEND ); - mpFS->singleElementNS( XML_a, XML_off, XML_x, IS( MM100toEMU( rRect.Left() ) ), XML_y, IS( MM100toEMU( rRect.Top() ) ), FSEND ); + sal_Int32 nLeft = rRect.Left(); + sal_Int32 nTop = rRect.Top(); + if (GetDocumentType() == DOCUMENT_DOCX && !m_xParent.is()) + { + nLeft = 0; + nTop = 0; + } + + mpFS->singleElementNS( XML_a, XML_off, XML_x, IS( MM100toEMU( nLeft ) ), XML_y, IS( MM100toEMU( nTop ) ), FSEND ); mpFS->singleElementNS( XML_a, XML_ext, XML_cx, IS( MM100toEMU( rRect.GetWidth() ) ), XML_cy, IS( MM100toEMU( rRect.GetHeight() ) ), FSEND ); mpFS->endElementNS( nXmlNamespace, XML_xfrm ); |