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

Caolán McNamara caolanm at redhat.com
Tue Oct 22 04:56:34 PDT 2013


 sd/source/ui/inc/slideshow.hxx                         |    5 ++
 sd/source/ui/slideshow/slideshowimpl.cxx               |    6 +-
 sd/source/ui/slideshow/slideshowimpl.hxx               |    2 
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |   29 ------------
 sd/source/ui/view/drviewse.cxx                         |   40 +++++++++++------
 sd/source/ui/view/outlnvs2.cxx                         |   30 ------------
 6 files changed, 39 insertions(+), 73 deletions(-)

New commits:
commit 438f5cf4229dafe2100e36d818b05535091054d7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 22 12:28:39 2013 +0100

    Resolves: fdo#69975 honour custom show settings
    
    if a custom show is set, then don't override it with
    current/first page, just accept it
    
    Change-Id: Icd04711028b3e11a576df6cd325ddb0db8974111

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 4793653..f8a4268 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1648,29 +1648,35 @@ namespace slideshowhelp
         Reference< XPresentation2 > xPresentation( rDoc.getPresentation() );
         if( xPresentation.is() )
         {
-            if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
+            if (SID_REHEARSE_TIMINGS == rReq.GetSlot())
+                xPresentation->rehearseTimings();
+            else if (rDoc.getPresentationSettings().mbCustomShow)
             {
-                if( (SID_PRESENTATION == rReq.GetSlot() ) )
-                {
-                    Sequence< PropertyValue > aArguments(1);
-                    PropertyValue aPage;
-                    OUString sValue("0");
-
-                    aPage.Name = "FirstPage";
-                    aPage.Value <<= sValue;
-
-                    aArguments[0] = aPage;
-
-                    xPresentation->startWithArguments( aArguments );
-                }
-                else
-                {
-                    xPresentation->start();
-                }
+                //fdo#69975 if a custom show has been set, then
+                //use it whether or not we've been asked to
+                //start from the current or first slide
+                xPresentation->start();
+            }
+            else if (SID_PRESENTATION_CURRENT_SLIDE == rReq.GetSlot())
+            {
+                //If there is no custom show set, start will automatically
+                //start at the current page
+                xPresentation->start();
             }
             else
             {
-                xPresentation->rehearseTimings();
+                //Start at page 0, this would blow away any custom
+                //show settings if any were set
+                Sequence< PropertyValue > aArguments(1);
+                PropertyValue aPage;
+                OUString sValue("0");
+
+                aPage.Name = "FirstPage";
+                aPage.Value <<= sValue;
+
+                aArguments[0] = aPage;
+
+                xPresentation->startWithArguments( aArguments );
             }
         }
     }
commit 368e94ce33bb4de1d2c0348082a349331a17f332
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 22 12:23:38 2013 +0100

    merge all three ShowSlideShow impls together
    
    Change-Id: If82f6313b258a79d59fbe34ab7846db5f9f45f76

diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx
index a309c82..be44a51 100644
--- a/sd/source/ui/inc/slideshow.hxx
+++ b/sd/source/ui/inc/slideshow.hxx
@@ -214,6 +214,11 @@ private:
     sal_Int32   mnInPlaceConfigEvent;
 };
 
+namespace slideshowhelp
+{
+    void ShowSlideShow(SfxRequest& rReq, SdDrawDocument &rDoc);
+}
+
 }
 
 #endif /* _SD_SLIDESHOW_HXX */
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 79c409c..53f077b 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -884,34 +884,7 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
 
 void SlotManager::ShowSlideShow( SfxRequest& rReq)
 {
-    Reference< XPresentation2 > xPresentation( mrSlideSorter.GetModel().GetDocument()->getPresentation() );
-    if( xPresentation.is() )
-    {
-        if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
-        {
-            if( (SID_PRESENTATION == rReq.GetSlot() ) )
-            {
-                Sequence< PropertyValue > aArguments(1);
-                PropertyValue aPage;
-                OUString sValue("0");
-
-                aPage.Name = "FirstPage";
-                aPage.Value <<= sValue;
-
-                aArguments[0] = aPage;
-
-                xPresentation->startWithArguments( aArguments );
-            }
-            else
-            {
-                xPresentation->start();
-            }
-        }
-        else
-        {
-            xPresentation->rehearseTimings();
-        }
-    }
+    slideshowhelp::ShowSlideShow(rReq, *mrSlideSorter.GetModel().GetDocument());
 }
 
 void SlotManager::RenameSlide (void)
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index f23b168..4793653 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1641,38 +1641,46 @@ void DrawViewShell::ShowUIControls (bool bVisible)
     maTabControl.Show (bVisible);
 }
 
-void DrawViewShell::ShowSlideShow(SfxRequest& rReq)
+namespace slideshowhelp
 {
-    Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
-    if( xPresentation.is() )
+    void ShowSlideShow(SfxRequest& rReq, SdDrawDocument &rDoc)
     {
-        if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
+        Reference< XPresentation2 > xPresentation( rDoc.getPresentation() );
+        if( xPresentation.is() )
         {
-            if( (SID_PRESENTATION == rReq.GetSlot() ) )
+            if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
             {
-                Sequence< PropertyValue > aArguments(1);
-                PropertyValue aPage;
-                OUString sValue("0");
+                if( (SID_PRESENTATION == rReq.GetSlot() ) )
+                {
+                    Sequence< PropertyValue > aArguments(1);
+                    PropertyValue aPage;
+                    OUString sValue("0");
 
-                aPage.Name = "FirstPage";
-                aPage.Value <<= sValue;
+                    aPage.Name = "FirstPage";
+                    aPage.Value <<= sValue;
 
-                aArguments[0] = aPage;
+                    aArguments[0] = aPage;
 
-                xPresentation->startWithArguments( aArguments );
+                    xPresentation->startWithArguments( aArguments );
+                }
+                else
+                {
+                    xPresentation->start();
+                }
             }
             else
             {
-                xPresentation->start();
+                xPresentation->rehearseTimings();
             }
         }
-        else
-        {
-            xPresentation->rehearseTimings();
-        }
     }
 }
 
+void DrawViewShell::ShowSlideShow(SfxRequest& rReq)
+{
+    slideshowhelp::ShowSlideShow(rReq, *GetDoc());
+}
+
 void DrawViewShell::StopSlideShow (bool /*bCloseFrame*/)
 {
     Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 23ead9a..6bdb2b3 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -63,6 +63,7 @@
 #include "sdabstdlg.hxx"
 #include "framework/FrameworkHelper.hxx"
 #include "DrawViewShell.hxx"
+#include "slideshow.hxx"
 #include <boost/scoped_ptr.hpp>
 
 using namespace ::com::sun::star::uno;
@@ -334,34 +335,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
 
 void OutlineViewShell::ShowSlideShow(SfxRequest& rReq)
 {
-    Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
-    if( xPresentation.is() )
-    {
-        if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
-        {
-            if( (SID_PRESENTATION == rReq.GetSlot() ) )
-            {
-                Sequence< PropertyValue > aArguments(1);
-                PropertyValue aPage;
-                OUString sValue("0");
-
-                aPage.Name = "FirstPage";
-                aPage.Value <<= sValue;
-
-                aArguments[0] = aPage;
-
-                xPresentation->startWithArguments( aArguments );
-            }
-            else
-            {
-                xPresentation->start();
-            }
-        }
-        else
-        {
-            xPresentation->rehearseTimings();
-        }
-    }
+    slideshowhelp::ShowSlideShow(rReq, *GetDoc());
 }
 
 void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
commit a1b0b68c0f1fe2467cddf021e09123085d043de2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 22 12:20:16 2013 +0100

    bStartWithActualSlide is always false
    
    Change-Id: Icf61858730e2576439fdc7bdd1c8a911f2b34bd7

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 3350675..7d6c44b 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -974,7 +974,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
         }
 
         // build page list
-        createSlideList( maPresSettings.mbAll, false, aPresSlide );
+        createSlideList( maPresSettings.mbAll, aPresSlide );
 
         // remember Slide number from where the show was started
         if( pStartPage )
@@ -2467,7 +2467,7 @@ Reference< XSlideShow > SlideshowImpl::createSlideShow() const
 
 // ---------------------------------------------------------
 
-void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, const OUString& rPresSlide )
+void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide )
 {
     const long nSlideCount = mpDoc->GetSdPageCount( PK_STANDARD );
 
@@ -2475,7 +2475,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
     {
         SdCustomShow*   pCustomShow;
 
-        if( !bStartWithActualSlide && mpDoc->GetCustomShowList() && maPresSettings.mbCustomShow )
+        if( mpDoc->GetCustomShowList() && maPresSettings.mbCustomShow )
             pCustomShow = mpDoc->GetCustomShowList()->GetCurObject();
         else
             pCustomShow = NULL;
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index b0cbcf1..48811dd 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -267,7 +267,7 @@ private:
 
     double update();
 
-    void createSlideList( bool bAll, bool bStartWithActualSlide, const OUString& rPresSlide );
+    void createSlideList( bool bAll, const OUString& rPresSlide );
 
     void displayCurrentSlide (const bool bSkipAllMainSequenceEffects = false);
 


More information about the Libreoffice-commits mailing list