diff options
-rw-r--r-- | oox/source/export/drawingml.cxx | 13 | ||||
-rw-r--r-- | sd/qa/unit/data/fdo79731.odp | bin | 0 -> 11008 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 12 |
3 files changed, 20 insertions, 5 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 641cb4daec84..96c90c589634 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1088,10 +1088,12 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32 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; } - } - if (!bSuppressRotation) - { - if (bFlipV) {nRotation=(nRotation+18000)%36000;} + + // 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); + uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (xPropertySetInfo->hasPropertyByName("RotateAngle")) + xPropertySet->getPropertyValue("RotateAngle") >>= nRotation; } WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, PPTX_EXPORT_ROTATE_CLOCKWISIFY(nRotation) ); } @@ -1791,7 +1793,8 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b if( !enumeration.is() ) return; - SdrObject* pSdrObject = GetSdrObjectFromXShape(uno::Reference<drawing::XShape>(rXIface, uno::UNO_QUERY_THROW)); + uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY); + SdrObject* pSdrObject = xShape.is() ? GetSdrObjectFromXShape(xShape) : 0; const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, pSdrObject); if (pTxtObj && mpTextExport) { diff --git a/sd/qa/unit/data/fdo79731.odp b/sd/qa/unit/data/fdo79731.odp Binary files differnew file mode 100644 index 000000000000..d5d094ae0125 --- /dev/null +++ b/sd/qa/unit/data/fdo79731.odp diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 640063ac180a..ede33d6fda7c 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -91,6 +91,7 @@ public: void testBnc480256(); void testCreationDate(); void testBnc584721_4(); + void testFdo79731(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -123,6 +124,7 @@ public: CPPUNIT_TEST(testBnc480256); CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testBnc584721_4); + CPPUNIT_TEST(testFdo79731); CPPUNIT_TEST_SUITE_END(); }; @@ -1105,6 +1107,16 @@ void SdFiltersTest::testBnc584721_4() xDocShRef->DoClose(); } +void SdFiltersTest::testFdo79731() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo79731.odp")); + xDocShRef = saveAndReload(xDocShRef, PPTX); + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT(pDoc); + xDocShRef->DoClose(); +} + + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); |