oox/source/vml/vmlshape.cxx                                  |   10 +++++++---
 sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                     |   11 +++++++++++
 3 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit 40a8b1f92c8befa39fc42e845994a00a70edab9f
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Fri Jan 17 12:16:04 2014 +0100

    VML import: fix rotation of simple shapes inside group shapes
    
    Change-Id: I28d2e2d801b06b92b5348123d88604fb4d10d828

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 31828db..9e6f208 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -642,9 +642,13 @@ Reference< XShape > SimpleShape::implConvertAndInsert( 
const Reference< XShapes
         if (oRotation)
         {
             lcl_SetRotation(aPropertySet, *oRotation);
-            // If rotation is used, simple setPosition() is not enough.
-            aPropertySet.setAnyProperty(PROP_HoriOrientPosition, makeAny( 
aShapeRect.X ) );
-            aPropertySet.setAnyProperty(PROP_VertOrientPosition, makeAny( 
aShapeRect.Y ) );
+            uno::Reference<lang::XServiceInfo> xServiceInfo(rxShapes, 
uno::UNO_QUERY);
+            if 
(!xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
+            {
+                // If rotation is used, simple setPosition() is not enough.
+                aPropertySet.setAnyProperty(PROP_HoriOrientPosition, 
makeAny(aShapeRect.X));
+                aPropertySet.setAnyProperty(PROP_VertOrientPosition, 
makeAny(aShapeRect.Y));
+            }
         }
 
         // When flip has 'x' or 'y', the associated ShapeRect will be changed 
but direction change doesn't occur.
diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx 
b/sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx
new file mode 100644
index 0000000..06aa39d
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b79b6fb..32e54d2 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -962,6 +962,17 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeLine, 
"groupshape-line.docx")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xShape->getSize().Height);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testGroupshapeChildRotation, 
"groupshape-child-rotation.docx")
+{
+    // The problem was that (due to incorrect handling of rotation inside
+    // groupshapes), the first child wasn't in the top left corner of an inline
+    // groupshape.
+    uno::Reference<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY);
+    uno::Reference<drawing::XShape> xShape(xGroupShape->getByIndex(0), 
uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xShape->getPosition().X);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xShape->getPosition().Y);
+}
+
 DECLARE_OOXMLIMPORT_TEST(testN793262, "n793262.docx")
 {
     uno::Reference<container::XEnumerationAccess> xHeaderText = getProperty< 
uno::Reference<container::XEnumerationAccess> 
>(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "HeaderText");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to