summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-06-25 13:43:11 +0300
committerJustin Luth <justin_luth@sil.org>2018-06-28 06:29:44 +0200
commitdea74f31d2a0062547e279bb934c60731f5e560d (patch)
tree194e2e9204b8b15a2bd5a075f408770a93ee78ad /oox
parentee81a4cd7778e3733b8237380b996fd3e4fee77b (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/56535 Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx29
1 files changed, 24 insertions, 5 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 1c0be28fdaf9..8992ff3ba0ba 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1369,7 +1369,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)
{
@@ -1392,11 +1392,8 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
if(bFlipH != bFlipV)
nRotation = nRotation * -1 + 36000;
- 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,
- bFlipHWrite, bFlipVWrite, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), bIsGroupShape);
+ bFlipHWrite, bFlipVWrite, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), IsGroupShape( rXShape ));
}
void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool bIsField, sal_Int32 nElement, bool bCheckDirect,
@@ -2079,6 +2076,28 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
}
}
+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 ) )