[Libreoffice-commits] core.git: 2 commits - oox/source sd/qa sd/source slideshow/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Wed Nov 18 09:28:48 PST 2015


 oox/source/ppt/slidetransition.cxx                                   |    4 
 oox/source/ppt/slidetransitioncontext.cxx                            |    1 
 sd/qa/unit/data/AllTransitions.odp                                   |binary
 sd/qa/unit/export-tests.cxx                                          |    5 
 sd/source/filter/eppt/pptx-epptooxml.cxx                             |    5 
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx |  107 +++++-----
 6 files changed, 74 insertions(+), 48 deletions(-)

New commits:
commit 59095c79787bbf9067514225b886d0c25d59e1ff
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Wed Nov 18 18:26:42 2015 +0100

    pptx: import/export of honeycomb slide transition
    
    Change-Id: I3edb77d5b046691e64d600d61dcd44e892c31301

diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index e5e87c9..de883c8 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -417,6 +417,10 @@ namespace oox { namespace ppt {
             mnTransitionType = TransitionType::MISCSHAPEWIPE;
             mnTransitionSubType = TransitionSubType::DIAMOND;
             break;
+        case P14_TOKEN(honeycomb):
+            mnTransitionType = TransitionType::MISCSHAPEWIPE;
+            mnTransitionSubType = TransitionSubType::HEART;
+            break;
         default:
             mnTransitionType = 0;
             break;
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index 0d0c783..589edb9 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -132,6 +132,7 @@ SlideTransitionContext::~SlideTransitionContext() throw()
     case P14_TOKEN( vortex ):
     case P14_TOKEN( ripple ):
     case P14_TOKEN( glitter ):
+    case P14_TOKEN( honeycomb ):
         // CT_Empty
         if (!mbHasTransition)
         {
diff --git a/sd/qa/unit/data/AllTransitions.odp b/sd/qa/unit/data/AllTransitions.odp
index 11c7c9c..dfb8d2a 100644
Binary files a/sd/qa/unit/data/AllTransitions.odp and b/sd/qa/unit/data/AllTransitions.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 02e42e7..eba8d7b 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1275,8 +1275,11 @@ void SdExportTest::testExportTransitionsPPTX()
     // GLITTER
     CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 72, TransitionType::MISCSHAPEWIPE, TransitionSubType::DIAMOND));
 
+    // HONEYCOMB
+    CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 73, TransitionType::MISCSHAPEWIPE, TransitionSubType::HEART));
+
     // NEWSFLASH
-    CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 73, TransitionType::ZOOM, TransitionSubType::ROTATEIN));
+    CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 74, TransitionType::ZOOM, TransitionSubType::ROTATEIN));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 95d6b38..e9b02e8 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -597,6 +597,11 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
                         pPattern = "hexagon";
                         bOOXmlSpecificTransition = true;
                         break;
+                    case animations::TransitionSubType::HEART: // Honeycomb
+                        nTransition = XML_fade;
+                        nTransition14 = XML_honeycomb;
+                        bOOXmlSpecificTransition = true;
+                        break;
                 }
                 break;
             }
commit 9f8392846bcf9fa5209834a0f79bd31aa06567a6
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Wed Nov 18 18:01:31 2015 +0100

    slideshow: improve "honeycomb" transition
    
    Change-Id: I8687127cd9ccf6a6ddd87d934f7462a69a047053

diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index 72427ab..e9c9214 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -1864,6 +1864,28 @@ std::shared_ptr<OGLTransitionImpl> makeRipple()
     return makeRippleTransition(aLeavingSlide, aEnteringSlide, aSettings);
 }
 
+void createHexagon(Primitive& aHexagon, const int x, const int y, const int NX, const int NY)
+{
+    if (y % 4 == 0)
+    {
+        aHexagon.pushTriangle(vec(x-1, y-1, NX, NY), vec(x,   y-2, NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x,   y-2, NX, NY), vec(x+1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x+1, y-1, NX, NY), vec(x+1, y,   NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x+1, y,   NX, NY), vec(x,   y+1, NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x,   y+1, NX, NY), vec(x-1, y,   NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x-1, y,   NX, NY), vec(x-1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+    }
+    else
+    {
+        aHexagon.pushTriangle(vec(x-2, y-1, NX, NY), vec(x-1, y-2, NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x-1, y-2, NX, NY), vec(x,   y-1, NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x,   y-1, NX, NY), vec(x,   y,   NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x,   y,   NX, NY), vec(x-1, y+1, NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x-1, y+1, NX, NY), vec(x-2, y,   NX, NY), vec(x, y+0.5, NX, NY));
+        aHexagon.pushTriangle(vec(x-2, y,   NX, NY), vec(x-2, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+    }
+}
+
 std::shared_ptr<OGLTransitionImpl> makeGlitter()
 {
     const int NX = 80;
@@ -1877,25 +1899,7 @@ std::shared_ptr<OGLTransitionImpl> makeGlitter()
         for (int x = 0; x < NX+2; x+=2)
         {
             Primitive aHexagon;
-
-            if (y % 4 == 0)
-            {
-                aHexagon.pushTriangle(vec(x-1, y-1, NX, NY), vec(x,   y-2, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y-2, NX, NY), vec(x+1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x+1, y-1, NX, NY), vec(x+1, y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x+1, y,   NX, NY), vec(x,   y+1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y+1, NX, NY), vec(x-1, y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-1, y,   NX, NY), vec(x-1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
-            }
-            else
-            {
-                aHexagon.pushTriangle(vec(x-2, y-1, NX, NY), vec(x-1, y-2, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-1, y-2, NX, NY), vec(x,   y-1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y-1, NX, NY), vec(x,   y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y,   NX, NY), vec(x-1, y+1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-1, y+1, NX, NY), vec(x-2, y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-2, y,   NX, NY), vec(x-2, y-1, NX, NY), vec(x, y+0.5, NX, NY));
-            }
+            createHexagon(aHexagon, x, y, NX, NY);
 
             glm::vec3 aCenter = aHexagon.getVertices()[2];
 
@@ -1920,59 +1924,68 @@ std::shared_ptr<OGLTransitionImpl> makeGlitter()
 
 std::shared_ptr<OGLTransitionImpl> makeHoneycomb()
 {
-    TransitionSettings aSettings;
-
-    const int NX = 15;
-    const int NY = NX * 4 / 3;
+    const int NX = 21;
+    const int NY = 21;
 
     Primitives_t aLeavingSlide;
     Primitives_t aEnteringSlide;
 
+    float fRandom = 0.0f;
+
+    int centerX = NX / 2;
+    int centerY = NY / 2;
+
     for (int y = 0; y < NY+2; y+=2)
     {
         for (int x = 0; x < NX+2; x+=2)
         {
             Primitive aHexagon;
+            createHexagon(aHexagon, x, y, NX, NY);
 
-            if (y % 4 == 0)
+            fRandom = comphelper::rng::uniform_real_distribution(0.2, std::nextafter(0.7, DBL_MAX));
+
+            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), 0 , false, -1, 0.1));
+            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), 90 , true, 0.2, 1.0));
+            if (x <= 0 || y <= 0 || x >= NX || y >= NY)
+            {
+                aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 100), false, 0.1, 1.0));
+            }
+            else if ((centerX - 1 <= x && x <= centerX + 1 && centerY - 1 <= y && y <= centerY + 1 ))
             {
-                aHexagon.pushTriangle(vec(x-1, y-1, NX, NY), vec(x,   y-2, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y-2, NX, NY), vec(x+1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x+1, y-1, NX, NY), vec(x+1, y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x+1, y,   NX, NY), vec(x,   y+1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y+1, NX, NY), vec(x-1, y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-1, y,   NX, NY), vec(x-1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 7), true, 0.0, 1.0));
+                aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 100), false, 0.1, 1.0));
             }
             else
             {
-                aHexagon.pushTriangle(vec(x-2, y-1, NX, NY), vec(x-1, y-2, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-1, y-2, NX, NY), vec(x,   y-1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y-1, NX, NY), vec(x,   y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x,   y,   NX, NY), vec(x-1, y+1, NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-1, y+1, NX, NY), vec(x-2, y,   NX, NY), vec(x, y+0.5, NX, NY));
-                aHexagon.pushTriangle(vec(x-2, y,   NX, NY), vec(x-2, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 7), true, 0.0, 1.0));
+                aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 100), false, fRandom, 1.0));
             }
 
-            float fRandom = comphelper::rng::uniform_real_distribution(0.0, std::nextafter(1.0, DBL_MAX));
-
-            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), 90 , true, 0.0, 1.0));
-            aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 7), true, 0.0, fRandom));
-            aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 100), false, fRandom, 1.0));
-
             aLeavingSlide.push_back(aHexagon);
 
             aHexagon.Operations.clear();
+
             aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), -90 , false, -1, 0.0));
-            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), 90 , true, 0.0, 1.0));
-            aHexagon.Operations.push_back(makeSTranslate(glm::vec3(-100, 0, 0),false, -1, 0));
-            aHexagon.Operations.push_back(makeSTranslate(glm::vec3(100, 0, -7),false, 0.0, 1));
-            aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 7), true, 0.0, 1));
+            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), 90 , true, 0.0, 0.8));
 
+            aHexagon.Operations.push_back(makeSTranslate(glm::vec3(-100, 0, -20), false, -1, 0));
+
+            if (x <= 0 || y <= 0 || x >= NX || y >= NY)
+            {
+                fRandom = comphelper::rng::uniform_real_distribution(0.85, std::nextafter(0.95, DBL_MAX));
+                aHexagon.Operations.push_back(makeSTranslate(glm::vec3(100, 0, 0), false, fRandom, 0.95));
+            }
+            else
+            {
+                fRandom = comphelper::rng::uniform_real_distribution(0.3, std::nextafter(0.8, DBL_MAX));
+                aHexagon.Operations.push_back(makeSTranslate(glm::vec3(100, 0, 0), false, fRandom, 0.9));
+            }
+            aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 20), true, 0.1, 1.0));
             aEnteringSlide.push_back(aHexagon);
         }
     }
 
-    return makeSimpleTransition(aLeavingSlide, aEnteringSlide, aSettings);
+    return makeSimpleTransition(aLeavingSlide, aEnteringSlide);
 }
 
 std::shared_ptr<OGLTransitionImpl> makeNewsflash()


More information about the Libreoffice-commits mailing list