summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-08-01 14:08:34 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-10 16:18:28 +0200
commitab296726263655bd3a722c125dd9cec2d507aaa5 (patch)
treec9221b42ec1cabd9fde7d62340d3f2776abc950b /oox
parent3cc5149a84c7b8cfaf0deb2e2f6c88c72343ee28 (diff)
tdf#91999 export/drawingml: shape rotate 180 is not special
This commit reverts the first (LO 4.3ish) regression commit 6063555744ed89d8a757b667cddcdd4357839466 and most of the two commits that tried to fix that: commit 9ae1e094d5a8a5b4432c88ebea0ca9fc1c79f602 and commit ee45d881efab230e7682f964d6ad4d00f85b0006 in LO6.0/6.2. The ooxmlexport6 unit test shows that there is nothing special about 180degrees. So, all transformations need to be avoided in docx format - not just 180 degree ones. I removed IsInGroupShape() since it is no longer being used - as per standard procedures. Change-Id: Id2bba5bc542875a10ac21fbb67f29b2d59705493 Reviewed-on: https://gerrit.libreoffice.org/58434 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx36
1 files changed, 4 insertions, 32 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index e0fc6dbae783..b19042e1c140 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1345,17 +1345,11 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
bFlipH = bFlipH && !bFlippedBeforeRotation;
bFlipV = bFlipV && !bFlippedBeforeRotation;
- bool bPositiveY = true;
- bool bPositiveX = true;
-
if (GetDocumentType() == DOCUMENT_DOCX && m_xParent.is())
{
awt::Point aParentPos = m_xParent->getPosition();
aPos.X -= aParentPos.X;
aPos.Y -= aParentPos.Y;
-
- bPositiveX = aParentPos.X >= 0;
- bPositiveY = aParentPos.Y >= 0;
}
if ( aSize.Width < 0 )
@@ -1366,24 +1360,13 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
{
SdrObject* pShape = GetSdrObjectFromXShape( rXShape );
nRotation = pShape ? pShape->GetRotateAngle() : 0;
- if (nRotation != 0 && nRotation != 18000)
+ if ( nRotation != 0 && GetDocumentType() != DOCUMENT_DOCX )
{
int faccos=bFlipV ? -1 : 1;
int facsin=bFlipH ? -1 : 1;
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 && IsGroupShape( rXShape, /*bOrChildShape=*/true ) )
- {
- if (!bFlipV && bPositiveX)
- {
- aPos.X -= aSize.Width;
- }
- if (!bFlipH && bPositiveY)
- {
- aPos.Y -= aSize.Height;
- }
- }
// The RotateAngle property's value is independent from any flipping, and that's exactly what we need here.
uno::Reference<beans::XPropertySet> xPropertySet(rXShape, uno::UNO_QUERY);
@@ -2080,21 +2063,10 @@ 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 DrawingML::IsGroupShape( const Reference< XShape >& rXShape ) const
{
- bool bRet = bOrChildShape && IsInGroupShape();
- if ( !bRet && rXShape.is() )
+ bool bRet = false;
+ if ( rXShape.is() )
{
uno::Reference<lang::XServiceInfo> xServiceInfo(rXShape, uno::UNO_QUERY_THROW);
bRet = xServiceInfo->supportsService("com.sun.star.drawing.GroupShape");