Change EnableNoYieldMode(bool) to better names

It makes no sense to disable something via an Enable function.
I have split the function into Enable and Disable functions, and
update the code accordingly.

Conflicts:
	include/vcl/svapp.hxx

Change-Id: Ic05d69796f43e802a4a2a16aaca44433b6eaa018
Reviewed-on: https://gerrit.libreoffice.org/7525
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Chris Sherlock
2014-01-19 13:13:07 +11:00
committed by Caolán McNamara
parent 2e10f314d0
commit 1d621d363c
3 changed files with 28 additions and 13 deletions

View File

@@ -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

View File

@@ -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<SlideshowImpl> 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<sal_uLong>(fUpdate * 1000.0) > 0);
Application::EnableNoYieldMode(false);
Application::DisableNoYieldMode();
Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
// Use a timer for the asynchronous callback.

View File

@@ -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 )