[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - include/oox oox/source sd/qa

Jan Holesovsky kendy at collabora.com
Wed Sep 6 14:57:17 UTC 2017


 dev/null                           |binary
 include/oox/export/drawingml.hxx   |    4 +-
 oox/source/export/drawingml.cxx    |   10 ------
 oox/source/export/shapes.cxx       |    6 +--
 sd/qa/unit/export-tests-ooxml2.cxx |   59 -------------------------------------
 5 files changed, 5 insertions(+), 74 deletions(-)

New commits:
commit 3595090d6a64de78a40f7d45c0088359d9d49f7b
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Sep 6 16:33:31 2017 +0200

    Revert "tdf#111798 Fix deformed export of flipped custom shapes to pptx"
    
    This work is incomplete, rather I'll fix my conflicts.
    
    This reverts commit 9c0387ef602d84d0079828f0ad4b53ada7ab1d8a.
    
    Change-Id: I20961cee4a5c28fc5486ca385974e9fcd5827dbe
    Reviewed-on: https://gerrit.libreoffice.org/42012
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index a3ad66897e80..97d8dff58de6 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -188,8 +188,8 @@ public:
             const OUString& rURL, bool bRelPathToMedia = false , const Graphic *pGraphic=nullptr );
     void WriteBlipMode( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, const OUString& rURL );
 
-    void WriteShapeTransformation(const css::uno::Reference< css::drawing::XShape >& rXShape,
-                  sal_Int32 nXmlNamespace, bool bFlipH = false, bool bFlipV = false, bool bSuppressRotation = false, bool bSuppressFlipping = false );
+    void WriteShapeTransformation( const css::uno::Reference< css::drawing::XShape >& rXShape,
+                  sal_Int32 nXmlNamespace, bool bFlipH = false, bool bFlipV = false, bool bSuppressRotation = false );
     void WriteTransformation( const Rectangle& rRectangle,
                   sal_Int32 nXmlNamespace, bool bFlipH = false, bool bFlipV = false, sal_Int32 nRotation = 0 );
 
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index cbf3abb513d7..c8d148aeb1c2 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1165,7 +1165,7 @@ void DrawingML::WriteTransformation( const Rectangle& rRect,
     mpFS->endElementNS( nXmlNamespace, XML_xfrm );
 }
 
-void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sal_Int32 nXmlNamespace, bool bFlipH, bool bFlipV, bool bSuppressRotation, bool bSuppressFlipping )
+void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sal_Int32 nXmlNamespace, bool bFlipH, bool bFlipV, bool bSuppressRotation  )
 {
     SAL_INFO("oox.shape",  "write shape transformation");
 
@@ -1202,14 +1202,6 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
         if (xPropertySetInfo->hasPropertyByName("RotateAngle"))
             xPropertySet->getPropertyValue("RotateAngle") >>= nRotation;
     }
-
-    // OOXML flips shapes before rotating them.
-    if(bFlipH != bFlipV)
-        nRotation = nRotation * -1 + 36000;
-
-    if(bSuppressFlipping)
-        bFlipH = bFlipV = false;
-
     WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation) );
 }
 
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index c4edcf07f1bb..1d4f4a20a217 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -827,7 +827,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
 
     if (bHasHandles && bCustGeom && pShape)
     {
-        WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV, false, true );// do not flip, polypolygon coordinates are flipped already
+        WriteShapeTransformation( xShape, XML_a ); // do not flip, polypolygon coordinates are flipped already
         tools::PolyPolygon aPolyPolygon( pShape->GetLineGeometry(true) );
         sal_Int32 nRotation = 0;
         // The RotateAngle property's value is independent from any flipping, and that's exactly what we need here.
@@ -835,10 +835,8 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
         uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
         if (xPropertySetInfo->hasPropertyByName("RotateAngle"))
             xPropertySet->getPropertyValue("RotateAngle") >>= nRotation;
-        // Remove rotation
-        bool bInvertRotation = bFlipH != bFlipV;
         if (nRotation != 0)
-            aPolyPolygon.Rotate(Point(0,0), static_cast<sal_uInt16>(bInvertRotation ? nRotation/10 : 3600-nRotation/10));
+            aPolyPolygon.Rotate(Point(0,0), static_cast<sal_uInt16>(3600-nRotation/10));
         WritePolyPolygon( aPolyPolygon );
     }
     else if (bCustGeom)
diff --git a/sd/qa/unit/data/odp/tdf111798.odp b/sd/qa/unit/data/odp/tdf111798.odp
deleted file mode 100644
index f00c0bec7fd1..000000000000
Binary files a/sd/qa/unit/data/odp/tdf111798.odp and /dev/null differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 3150687c04cb..817cad398a13 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -104,7 +104,6 @@ public:
     void testTdf92076();
     void testTdf59046();
     void testTdf105739();
-    void testTdf111798();
     void testTdf111518();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -133,7 +132,6 @@ public:
     CPPUNIT_TEST(testTdf92076);
     CPPUNIT_TEST(testTdf59046);
     CPPUNIT_TEST(testTdf105739);
-    CPPUNIT_TEST(testTdf111798);
     CPPUNIT_TEST(testTdf111518);
 
     CPPUNIT_TEST_SUITE_END();
@@ -794,63 +792,6 @@ void SdOOXMLExportTest2::testTdf105739()
     xShell->DoClose();
 }
 
-void SdOOXMLExportTest2::testTdf111798()
-{
-    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf111798.odp"), ODP);
-    utl::TempFile tempFile;
-    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
-    xDocShRef->DoClose();
-    xmlDocPtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
-
-    const OUString data[][29] =
-    {
-        {
-            "2700000", "2458080", "2414880", "1439640", "1440000",
-            "moveTo",  "0",    "3000",
-            "lnTo[1]", "3000", "3000",
-            "lnTo[2]", "3000", "4000",
-            "lnTo[3]", "4000", "2000",
-            "lnTo[4]", "3000", "0",
-            "lnTo[5]", "3000", "1000",
-            "lnTo[6]", "0",    "1000",
-            "lnTo[7]", "0",    "3000"
-        },
-        {
-            "2700000", "6778080", "2414880", "1439640", "1440000",
-            "moveTo",  "3000", "0",
-            "lnTo[1]", "3000", "3000",
-            "lnTo[2]", "4000", "3000",
-            "lnTo[3]", "2000", "4000",
-            "lnTo[4]", "0", "3000",
-            "lnTo[5]", "1000", "3000",
-            "lnTo[6]", "1000", "0",
-            "lnTo[7]", "3000", "0"
-        }
-    };
-
-    for (size_t nShapeIndex = 0; nShapeIndex < SAL_N_ELEMENTS(data); nShapeIndex++)
-    {
-        size_t nDataIndex = 0;
-
-        const OString sSpPr = "/p:sld/p:cSld/p:spTree/p:sp[" + OString::number(nShapeIndex + 1) + "]/p:spPr";
-        const OString sXfrm = sSpPr + "/a:xfrm";
-        assertXPath(pXmlDoc, sXfrm, "rot", data[nShapeIndex][nDataIndex++]);
-        const OString sOff = sXfrm + "/a:off";
-        assertXPath(pXmlDoc, sOff, "x", data[nShapeIndex][nDataIndex++]);
-        assertXPath(pXmlDoc, sOff, "y", data[nShapeIndex][nDataIndex++]);
-        const OString sExt = sXfrm + "/a:ext";
-        assertXPath(pXmlDoc, sExt, "cx", data[nShapeIndex][nDataIndex++]);
-        assertXPath(pXmlDoc, sExt, "cy", data[nShapeIndex][nDataIndex++]);
-
-        while (nDataIndex < SAL_N_ELEMENTS(data[nShapeIndex]))
-        {
-            const OString sPt = sSpPr + "/a:custGeom/a:pathLst/a:path/a:" + data[nShapeIndex][nDataIndex++].toUtf8() + "/a:pt";
-            assertXPath(pXmlDoc, sPt, "x", data[nShapeIndex][nDataIndex++]);
-            assertXPath(pXmlDoc, sPt, "y", data[nShapeIndex][nDataIndex++]);
-        }
-    }
-}
-
 void SdOOXMLExportTest2::testTdf111518()
 {
     sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf111518.pptx"), PPTX);


More information about the Libreoffice-commits mailing list