diff options
author | Justin Luth <justin.luth@collabora.com> | 2018-06-25 13:43:11 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-08-10 10:55:34 +0200 |
commit | 16c55437f5402c4e786de1e23b2bc606c4e288c6 (patch) | |
tree | a17fe094148f2af842f7351260678a7111476749 /oox | |
parent | 68062b13fa6d3d7a6faaa487833c118911324fc1 (diff) |
tdf#114845 sd: only shift rotated group items
fixes 6.0 commit 9ae1e094d5a8a5b4432c88ebea0ca9fc1c79f602
> PPTX export: correct position of rotated groups
However, there was nothing excluding the re-positioning
to only group items.
Change-Id: I62e36b46c0d2ac3e41f8d7d4ed82df11e6eb1ee5
Reviewed-on: https://gerrit.libreoffice.org/56386
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/56542
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
(cherry picked from commit 3fdff39af3b793f68f9c72d940590948dbb840e2)
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 1067240fbe81..72ae498eb31f 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1344,7 +1344,7 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa aPos.X-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Width/2-facsin*sin(nRotation*F_PI18000)*aSize.Height/2; aPos.Y-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Height/2+facsin*sin(nRotation*F_PI18000)*aSize.Width/2; } - else if(nRotation == 18000) + else if ( nRotation == 18000 && IsGroupShape( rXShape, /*bOrChildShape=*/true ) ) { if (!bFlipV && bPositiveX) { @@ -1370,11 +1370,8 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa if(bSuppressFlipping) bFlipH = bFlipV = false; - uno::Reference<lang::XServiceInfo> xServiceInfo(rXShape, uno::UNO_QUERY_THROW); - bool bIsGroupShape = (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")); - WriteTransformation(tools::Rectangle(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)), nXmlNamespace, - bFlipH, bFlipV, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), bIsGroupShape); + bFlipH, bFlipV, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), IsGroupShape( rXShape )); } void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool bIsField, sal_Int32 nElement, bool bCheckDirect, @@ -2046,6 +2043,28 @@ void DrawingML::WriteParagraphNumbering( const Reference< XPropertySet >& rXProp } } +bool DrawingML::IsInGroupShape () const +{ + bool bRet = m_xParent.is(); + if ( bRet ) + { + uno::Reference<lang::XServiceInfo> xServiceInfo(m_xParent, uno::UNO_QUERY_THROW); + bRet = xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"); + } + return bRet; +} + +bool DrawingML::IsGroupShape( const Reference< XShape >& rXShape, bool bOrChildShape ) const +{ + bool bRet = bOrChildShape && IsInGroupShape(); + if ( !bRet ) + { + uno::Reference<lang::XServiceInfo> xServiceInfo(rXShape, uno::UNO_QUERY_THROW); + bRet = xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"); + } + return bRet; +} + sal_Int32 DrawingML::getBulletMarginIndentation (const Reference< XPropertySet >& rXPropSet,sal_Int16 nLevel, const OUString& propName) { if( nLevel < 0 || !GETA( NumberingRules ) ) |