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

Andrzej J.R. Hunt andrzej at ahunt.org
Sun Sep 8 22:51:35 PDT 2013


 sd/source/ui/animations/SlideTransitionPane.cxx |   16 ++++++++++++++--
 sd/source/ui/animations/SlideTransitionPane.hxx |    1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 85557c1c7fd672ab2156d92c6e164f55f5650ea3
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Sun Sep 8 18:01:26 2013 +0100

    Stop transition preview if "No transition" is selected.
    
    Currently a transition preview continues playing until it either
    completes, a different transition is selected (in which case the
    new preview starts) or the user clicks on the preview. However
    when "No transition" is selected whilst a preview is still playing
    then the prveview continues to play.
    
    This will also be useful for fdo#36946 which would introduce
    categories into the list which themselves aren't valid transitions,
    therefore we would want to stop any previews on progress when selecting
    a non-transition in the list.
    
    Change-Id: I708fcc017a94173c91cb45bef18255f97debfd57

diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 4175ae5..a89126c 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -874,16 +874,20 @@ void SlideTransitionPane::applyToSelectedPages()
     if( ! mbUpdatingControls )
     {
         ::sd::slidesorter::SharedPageSelection pSelectedPages( getSelectedPages());
+        impl::TransitionEffect aEffect = getTransitionEffectFromControls();
         if( ! pSelectedPages->empty())
         {
             lcl_CreateUndoForPages( pSelectedPages, mrBase );
-            lcl_ApplyToPages( pSelectedPages, getTransitionEffectFromControls() );
+            lcl_ApplyToPages( pSelectedPages, aEffect );
             mrBase.GetDocShell()->SetModified();
         }
         if( mpCB_AUTO_PREVIEW->IsEnabled() &&
             mpCB_AUTO_PREVIEW->IsChecked())
         {
-            playCurrentEffect();
+            if (aEffect.mnType) // mnType = 0 denotes no transition
+                playCurrentEffect();
+            else
+                stopEffects();
         }
     }
 }
@@ -898,6 +902,14 @@ void SlideTransitionPane::playCurrentEffect()
     }
 }
 
+void SlideTransitionPane::stopEffects()
+{
+    if( mxView.is() )
+    {
+        SlideShow::Stop( mrBase );
+    }
+}
+
 void SlideTransitionPane::addListener()
 {
     Link aLink( LINK(this,SlideTransitionPane,EventMultiplexerListener) );
diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx
index 6ca28ee..4740f24 100644
--- a/sd/source/ui/animations/SlideTransitionPane.hxx
+++ b/sd/source/ui/animations/SlideTransitionPane.hxx
@@ -77,6 +77,7 @@ private:
 
     void applyToSelectedPages();
     void playCurrentEffect();
+    void stopEffects();
 
     void addListener();
     void removeListener();


More information about the Libreoffice-commits mailing list