[Libreoffice-commits] core.git: sd/source

Michael Meeks michael.meeks at collabora.com
Fri Nov 13 16:35:10 PST 2015


 sd/source/ui/animations/SlideTransitionPane.cxx |   43 ++++++++++++++----------
 1 file changed, 26 insertions(+), 17 deletions(-)

New commits:
commit b58be9e8f983d1d0ca10a6ebe903c9a6482cefdd
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Sat Nov 14 00:39:28 2015 +0000

    Fix selection of transition groups with just one variant.
    
    Change-Id: I3a49fd336961b860f4b19b37a8d18cef8e4a5557

diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index e223d11..e3fb90c 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -772,28 +772,37 @@ impl::TransitionEffect SlideTransitionPane::getTransitionEffectFromControls() co
         auto aSelected = rPresetList.begin();
         std::advance( aSelected, mpVS_TRANSITION_ICONS->GetSelectItemId() - 1);
 
-        int nVariant = 0;
-        bool bFound = false;
-        for( auto aIter: rPresetList )
+        if( mpLB_VARIANT->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND )
         {
-            if( aIter->getSetId() == (*aSelected)->getSetId() )
+            // Transition with just one effect.
+            aResult = impl::TransitionEffect( **aSelected );
+            aResult.setAllAmbiguous();
+        }
+        else
+        {
+            int nVariant = 0;
+            bool bFound = false;
+            for( auto aIter: rPresetList )
             {
-                if( mpLB_VARIANT->GetSelectEntryPos() == nVariant)
-                {
-                    aResult = impl::TransitionEffect( *aIter );
-                    aResult.setAllAmbiguous();
-                    bFound = true;
-                    break;
-                }
-                else
+                if( aIter->getSetId() == (*aSelected)->getSetId() )
                 {
-                    nVariant++;
+                    if( mpLB_VARIANT->GetSelectEntryPos() == nVariant)
+                    {
+                        aResult = impl::TransitionEffect( *aIter );
+                        aResult.setAllAmbiguous();
+                        bFound = true;
+                        break;
+                    }
+                    else
+                    {
+                        nVariant++;
+                    }
                 }
             }
-        }
-        if( !bFound )
-        {
-            aResult.mnType = 0;
+            if( !bFound )
+            {
+                aResult.mnType = 0;
+            }
         }
         aResult.mbEffectAmbiguous = false;
     }


More information about the Libreoffice-commits mailing list