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:
committed by
Caolán McNamara
parent
2e10f314d0
commit
1d621d363c
@@ -469,17 +469,26 @@ public:
|
|||||||
"No yield" mode prevents @Yield from waiting for events.
|
"No yield" mode prevents @Yield from waiting for events.
|
||||||
|
|
||||||
@remarks This was originally implemented in OOo bug 98792 to improve
|
@remarks This was originally implemented in OOo bug 98792 to improve
|
||||||
Impress slideshows. For some reason, to \em disable no yield mode, you
|
Impress slideshows.
|
||||||
call on EnableNoYieldMode
|
|
||||||
|
|
||||||
@param i_bNoYield If set to false, then "no yield" mode is turned off.
|
@see DisableNoYieldMode, Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
|
||||||
If set to true, then "no yield" mode is turned on.
|
|
||||||
|
|
||||||
@see Execute, Quit, Reschedule, Yield, EndYield, GetSolarMutex,
|
|
||||||
GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
|
GetMainThreadIdentifier, ReleaseSolarMutex, AcquireSolarMutex,
|
||||||
AddPostYieldListener, RemovePostYieldListener
|
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
|
/** Add a listener for yield events
|
||||||
|
|
||||||
|
@@ -760,7 +760,7 @@ void SAL_CALL SlideshowImpl::disposing()
|
|||||||
|
|
||||||
setActiveXToolbarsVisible( sal_True );
|
setActiveXToolbarsVisible( sal_True );
|
||||||
|
|
||||||
Application::EnableNoYieldMode(false);
|
Application::DisableNoYieldMode();
|
||||||
Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
||||||
|
|
||||||
mbDisposed = true;
|
mbDisposed = true;
|
||||||
@@ -1855,7 +1855,7 @@ IMPL_LINK_NOARG(SlideshowImpl, PostYieldListener)
|
|||||||
// prevent me from deletion when recursing (App::Reschedule does)
|
// prevent me from deletion when recursing (App::Reschedule does)
|
||||||
const rtl::Reference<SlideshowImpl> this_(this);
|
const rtl::Reference<SlideshowImpl> this_(this);
|
||||||
|
|
||||||
Application::EnableNoYieldMode(false);
|
Application::DisableNoYieldMode();
|
||||||
Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
||||||
Application::Reschedule(true); // fix for fdo#32861 - process
|
Application::Reschedule(true); // fix for fdo#32861 - process
|
||||||
// *all* outstanding events after
|
// *all* outstanding events after
|
||||||
@@ -1896,7 +1896,7 @@ sal_Int32 SlideshowImpl::updateSlideShow (void)
|
|||||||
if (::basegfx::fTools::equalZero(fUpdate))
|
if (::basegfx::fTools::equalZero(fUpdate))
|
||||||
{
|
{
|
||||||
// Use post yield listener for short update intervalls.
|
// Use post yield listener for short update intervalls.
|
||||||
Application::EnableNoYieldMode(true);
|
Application::EnableNoYieldMode();
|
||||||
Application::AddPostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
Application::AddPostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1917,7 +1917,7 @@ sal_Int32 SlideshowImpl::updateSlideShow (void)
|
|||||||
// integer may lead to zero value.)
|
// integer may lead to zero value.)
|
||||||
OSL_ASSERT(static_cast<sal_uLong>(fUpdate * 1000.0) > 0);
|
OSL_ASSERT(static_cast<sal_uLong>(fUpdate * 1000.0) > 0);
|
||||||
|
|
||||||
Application::EnableNoYieldMode(false);
|
Application::DisableNoYieldMode();
|
||||||
Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener));
|
||||||
|
|
||||||
// Use a timer for the asynchronous callback.
|
// Use a timer for the asynchronous callback.
|
||||||
|
@@ -986,10 +986,16 @@ void Application::RemoveIdleHdl( const Link& rLink )
|
|||||||
pSVData->maAppData.mpIdleMgr->RemoveIdleHdl( rLink );
|
pSVData->maAppData.mpIdleMgr->RemoveIdleHdl( rLink );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::EnableNoYieldMode( bool i_bNoYield )
|
void Application::EnableNoYieldMode()
|
||||||
{
|
{
|
||||||
ImplSVData* pSVData = ImplGetSVData();
|
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 )
|
void Application::AddPostYieldListener( const Link& i_rListener )
|
||||||
|
Reference in New Issue
Block a user