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

Michael Meeks michael.meeks at collabora.com
Thu May 21 08:29:32 PDT 2015


 sd/source/ui/animations/CustomAnimationPane.cxx |  102 +++++++++++-------------
 sfx2/source/dialog/dockwin.cxx                  |    3 
 2 files changed, 53 insertions(+), 52 deletions(-)

New commits:
commit 99938e7bc8a305dcc9733adbe635e25a38afed31
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu May 21 16:26:37 2015 +0100

    tdf#91381 - fix a couple of animation related lifecycle issues.
    
    Change-Id: I4aada7f27e3a88124ad670e62ddb6c92ecf431a8

diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index d7a97cb..ca19853 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1752,76 +1752,74 @@ void CustomAnimationPane::onChange( bool bCreate )
         }
     }
 
-    VclPtrInstance< CustomAnimationCreateDialog > pDlg( this, this, aTargets, bHasText, sPresetId, fDuration );
-    if( pDlg->Execute() )
     {
-        addUndo();
-        fDuration = pDlg->getSelectedDuration();
-        CustomAnimationPresetPtr pDescriptor = pDlg->getSelectedPreset();
-        if( pDescriptor.get() )
+        ScopedVclPtrInstance< CustomAnimationCreateDialog > pDlg( this, this, aTargets, bHasText, sPresetId, fDuration );
+        if( pDlg->Execute() )
         {
-            if( bCreate )
+            addUndo();
+            fDuration = pDlg->getSelectedDuration();
+            CustomAnimationPresetPtr pDescriptor = pDlg->getSelectedPreset();
+            if( pDescriptor.get() )
             {
-                mpCustomAnimationList->SelectAll( false );
-
-                // gather shapes from the selection
-                std::vector< Any >::iterator aIter( aTargets.begin() );
-                const std::vector< Any >::iterator aEnd( aTargets.end() );
-                bool bFirst = true;
-                for( ; aIter != aEnd; ++aIter )
+                if( bCreate )
                 {
-                    CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration );
+                    mpCustomAnimationList->SelectAll( false );
 
-                    // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs
-                    if( bHasText && (aTargets.size() == 1) )
+                    // gather shapes from the selection
+                    std::vector< Any >::iterator aIter( aTargets.begin() );
+                    const std::vector< Any >::iterator aEnd( aTargets.end() );
+                    bool bFirst = true;
+                    for( ; aIter != aEnd; ++aIter )
                     {
-                        Reference< XShape > xShape( (*aIter), UNO_QUERY );
-                        if( xShape.is() && !hasVisibleShape( xShape ) )
+                        CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration );
+
+                        // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs
+                        if( bHasText && (aTargets.size() == 1) )
                         {
-                            mpMainSequence->createTextGroup( pCreated, 1, -1.0, false, false );
+                            Reference< XShape > xShape( (*aIter), UNO_QUERY );
+                            if( xShape.is() && !hasVisibleShape( xShape ) )
+                            {
+                                mpMainSequence->createTextGroup( pCreated, 1, -1.0, false, false );
+                            }
                         }
-                    }
 
-                    if( bFirst )
-                        bFirst = false;
-                    else
-                        pCreated->setNodeType( EffectNodeType::WITH_PREVIOUS );
+                        if( bFirst )
+                            bFirst = false;
+                        else
+                            pCreated->setNodeType( EffectNodeType::WITH_PREVIOUS );
 
-                    if( pCreated.get() )
-                    {
-                        mpCustomAnimationList->select( pCreated );
+                        if( pCreated.get() )
+                            mpCustomAnimationList->select( pCreated );
                     }
                 }
-            }
-            else
-            {
-                MainSequenceRebuildGuard aGuard( mpMainSequence );
-
-                // get selected effect
-                EffectSequence::iterator aIter( maListSelection.begin() );
-                const EffectSequence::iterator aEnd( maListSelection.end() );
-                while( aIter != aEnd )
+                else
                 {
-                    CustomAnimationEffectPtr pEffect = (*aIter++);
+                    MainSequenceRebuildGuard aGuard( mpMainSequence );
 
-                    EffectSequenceHelper* pEffectSequence = pEffect->getEffectSequence();
-                    if( !pEffectSequence )
-                        pEffectSequence = mpMainSequence.get();
+                    // get selected effect
+                    EffectSequence::iterator aIter( maListSelection.begin() );
+                    const EffectSequence::iterator aEnd( maListSelection.end() );
+                    while( aIter != aEnd )
+                    {
+                        CustomAnimationEffectPtr pEffect = (*aIter++);
+
+                        EffectSequenceHelper* pEffectSequence = pEffect->getEffectSequence();
+                        if( !pEffectSequence )
+                            pEffectSequence = mpMainSequence.get();
 
-                    pEffectSequence->replace( pEffect, pDescriptor, fDuration );
+                        pEffectSequence->replace( pEffect, pDescriptor, fDuration );
+                    }
                 }
             }
+            else
+            {
+                PathKind eKind = pDlg->getCreatePathKind();
+                if( eKind != PathKind::NONE )
+                    createPath( eKind, aTargets, fDuration );
+            }
+            mrBase.GetDocShell()->SetModified();
         }
-        else
-        {
-            PathKind eKind = pDlg->getCreatePathKind();
-            if( eKind != PathKind::NONE )
-                createPath( eKind, aTargets, fDuration );
-        }
-        mrBase.GetDocShell()->SetModified();
-    }
-
-    pDlg.reset();
+    } // dispose pDlg
 
     updateControls();
 
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 35bc945..83c68dc 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -1729,6 +1729,9 @@ Size SfxDockingWindow::GetMinOutputSizePixel() const
 
 bool SfxDockingWindow::Notify( NotifyEvent& rEvt )
 {
+    if ( !pImp )
+        return DockingWindow::Notify( rEvt );
+
     if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS )
     {
         if (pMgr != NULL)


More information about the Libreoffice-commits mailing list