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

Katarina Behrens bubli at bubli.org
Sat Mar 23 13:55:10 PDT 2013


 sd/source/ui/slideshow/slideshowimpl.cxx |   17 ++++++++++-------
 sd/source/ui/slideshow/slideshowimpl.hxx |    2 +-
 2 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit e8b924e440a8f82076389d2774d1c414c87924dc
Author: Katarina Behrens <bubli at bubli.org>
Date:   Sat Mar 23 21:47:24 2013 +0100

    Start slideshow with the next visible slide, part2
    
    simplify it a bit. Also fix fdo#62665, as a side effect
    
    Change-Id: I77e3d9d261f0d313d6514897d2d4923de32b3591

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 6ba66de..fd29a7b 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -942,9 +942,13 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
 
         if( bStartWithActualSlide )
         {
-            aPresSlide = pStartPage->GetName();
-            // if the starting slide is hidden, we can't set slide controller to ALL mode
-            maPresSettings.mbAll = !pStartPage->IsExcluded();
+            if ( !aPresSlide.Len())
+            {
+                // no preset slide yet, so pick current on one
+                aPresSlide = pStartPage->GetName();
+                // if the starting slide is hidden, we can't set slide controller to ALL mode
+                maPresSettings.mbAll = !pStartPage->IsExcluded();
+            }
 
             if( meAnimationMode != ANIMATIONMODE_SHOW )
             {
@@ -966,9 +970,8 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
             }
         }
 
-        sal_Int32 nSlideNum = ( pStartPage->GetPageNum() - 1 ) >> 1;
         // build page list
-        createSlideList( maPresSettings.mbAll, false, aPresSlide, nSlideNum );
+        createSlideList( maPresSettings.mbAll, false, aPresSlide );
 
         // remember Slide number from where the show was started
         if( pStartPage )
@@ -2429,7 +2432,7 @@ Reference< XSlideShow > SlideshowImpl::createSlideShow() const
 
 // ---------------------------------------------------------
 
-void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide, sal_Int32 nStartSlide )
+void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide )
 {
     const long nSlideCount = mpDoc->GetSdPageCount( PK_STANDARD );
 
@@ -2462,7 +2465,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
                 sal_Int32 nSlide;
                 sal_Bool bTakeNextAvailable = sal_False;
 
-                for( nSlide = nStartSlide, nFirstVisibleSlide = -1;
+                for( nSlide = 0, nFirstVisibleSlide = -1;
                     ( nSlide < nSlideCount ) && ( -1 == nFirstVisibleSlide ); nSlide++ )
                 {
                     SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt16)nSlide, PK_STANDARD );
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index ca968c4..7f87ea0 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -265,7 +265,7 @@ private:
 
     double update();
 
-    void createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide, sal_Int32 nStartSlide = 0 );
+    void createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide );
 
     void displayCurrentSlide (const bool bSkipAllMainSequenceEffects = false);
 


More information about the Libreoffice-commits mailing list