diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 0432a1755572..8e7b053961fb 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -469,17 +469,26 @@ public: "No yield" mode prevents @Yield from waiting for events. @remarks This was originally implemented in OOo bug 98792 to improve - Impress slideshows. For some reason, to \em disable no yield mode, you - call on EnableNoYieldMode + Impress slideshows. - @param i_bNoYield If set to false, then "no yield" mode is turned off. - If set to true, then "no yield" mode is turned on. - - @see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, + @see DisableNoYieldMode, Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, AddPostYieldListener, RemovePostYieldListener */ - static void EnableNoYieldMode( bool i_bNoYield ); + static void EnableNoYieldMode(); + + /** @Brief Disables "no yield" mode + + "No yield" mode prevents @Yield from waiting for events. + + @remarks This was originally implemented in OOo bug 98792 to improve + Impress slideshows. + + @see EnableNoYieldMode, Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex, + GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex, + AddPostYieldListener, RemovePostYieldListener + */ + static void DisableNoYieldMode(); /** Add a listener for yield events diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 87e6435bc2a7..2bc4d722770b 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -760,7 +760,7 @@ void SAL_CALL SlideshowImpl::disposing() setActiveXToolbarsVisible( sal_True ); - Application::EnableNoYieldMode(false); + Application::DisableNoYieldMode(); Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); mbDisposed = true; @@ -1855,7 +1855,7 @@ IMPL_LINK_NOARG(SlideshowImpl, PostYieldListener) // prevent me from deletion when recursing (App::Reschedule does) const rtl::Reference this_(this); - Application::EnableNoYieldMode(false); + Application::DisableNoYieldMode(); Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); Application::Reschedule(true); // fix for fdo#32861 - process // *all* outstanding events after @@ -1896,7 +1896,7 @@ sal_Int32 SlideshowImpl::updateSlideShow (void) if (::basegfx::fTools::equalZero(fUpdate)) { // Use post yield listener for short update intervalls. - Application::EnableNoYieldMode(true); + Application::EnableNoYieldMode(); Application::AddPostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); } else @@ -1917,7 +1917,7 @@ sal_Int32 SlideshowImpl::updateSlideShow (void) // integer may lead to zero value.) OSL_ASSERT(static_cast(fUpdate * 1000.0) > 0); - Application::EnableNoYieldMode(false); + Application::DisableNoYieldMode(); Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); // Use a timer for the asynchronous callback. diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 6d345f376b27..a754856c9608 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -986,10 +986,16 @@ void Application::RemoveIdleHdl( const Link& rLink ) pSVData->maAppData.mpIdleMgr->RemoveIdleHdl( rLink ); } -void Application::EnableNoYieldMode( bool i_bNoYield ) +void Application::EnableNoYieldMode() { ImplSVData* pSVData = ImplGetSVData(); - pSVData->maAppData.mbNoYield = i_bNoYield; + pSVData->maAppData.mbNoYield = true; +} + +void Application::DisableNoYieldMode() +{ + ImplSVData* pSVData = ImplGetSVData(); + pSVData->maAppData.mbNoYield = false; } void Application::AddPostYieldListener( const Link& i_rListener )