noticed this with a customer document, the rotation an imported shape ( e.g. a custom shape like an arrow ) when the anchor is twoCell is determined by the anchor position and geometry, applying the rotation screws up the import completely, not only is the shape now rotated incorrectly but the position is all messed up too

Noel

>From f78a9b6ce1aaf320ed75dd15ee42a650f6c0c1d5 Mon Sep 17 00:00:00 2001
From: Noel Power <noel.po...@novell.com>
Date: Wed, 30 May 2012 14:06:27 +0100
Subject: [PATCH 5/7] don't rotate calc shapes if twoCellAnchor, partial fix bnc#762542

Change-Id: I3ccf6d87db2e9c33f2adaf92e138018f2e27528b
---
 oox/source/xls/drawingfragment.cxx |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index 64f0164..c547b76 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -274,6 +274,10 @@ void DrawingFragment::onEndElement()
         case XDR_TOKEN( twoCellAnchor ):
             if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() )
             {
+                // Rotation is decided by orientation of shape determined
+                // by the anchor position given by 'twoCellAnchor'
+                if ( getCurrentElement() == XDR_TOKEN( twoCellAnchor ) )
+                    mxShape->setRotation(0);
                 EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( getDrawPageSize() );
                 if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) )
                 {
-- 
1.7.3.4


_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to