Kaydet (Commit) f0a6ec25 authored tarafından Jennifer Liebel's avatar Jennifer Liebel Kaydeden (comit) Tobias Madl

changed timers to idle

Change-Id: I05ccb8bd73070462edcc911956859aa7967b5901
üst 9f3e3923
......@@ -310,7 +310,7 @@ namespace framework
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowStateSupplier;
GlobalSettings* m_pGlobalSettings;
OUString m_aModuleIdentifier;
Idle m_aAsyncLayoutIdle;
Timer m_aAsyncLayoutTimer;
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; // container for ALL Listener
ToolbarLayoutManager* m_pToolbarManager;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener > m_xToolbarManager;
......
......@@ -208,7 +208,7 @@ class ToolBarManager : public ToolbarManager_Base
CommandToInfoMap m_aCommandMap;
SubToolBarToSubToolBarControllerMap m_aSubToolBarControllerMap;
Idle m_aAsyncUpdateControllersIdle;
Timer m_aAsyncUpdateControllersTimer;
OUString m_sIconTheme;
MenuDescriptionMap m_aMenuMap;
bool m_bAcceleratorCfg;
......
......@@ -144,8 +144,8 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) :
Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) );
m_aAsyncLayoutIdle.SetPriority( VCL_IDLE_PRIORITY_RESIZE );
m_aAsyncLayoutIdle.SetIdleHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) );
m_aAsyncLayoutTimer.SetTimeout( 50 );
m_aAsyncLayoutTimer.SetTimeoutHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) );
registerProperty( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, css::beans::PropertyAttribute::TRANSIENT, &m_bAutomaticToolbars, ::getCppuType( &m_bAutomaticToolbars ) );
registerProperty( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, beans::PropertyAttribute::TRANSIENT, &m_bHideCurrentUI, ::getCppuType( &m_bHideCurrentUI ) );
......@@ -158,7 +158,7 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) :
LayoutManager::~LayoutManager()
{
Application::RemoveEventListener( LINK( this, LayoutManager, SettingsChanged ) );
m_aAsyncLayoutIdle.Stop();
m_aAsyncLayoutTimer.Stop();
setDockingAreaAcceptor(NULL);
delete m_pGlobalSettings;
}
......@@ -1256,7 +1256,7 @@ throw ( RuntimeException, std::exception )
// IMPORTANT: Be sure to stop layout timer if don't have a docking area acceptor!
if ( !xDockingAreaAcceptor.is() )
m_aAsyncLayoutIdle.Stop();
m_aAsyncLayoutTimer.Stop();
bool bAutomaticToolbars( m_bAutomaticToolbars );
std::vector< Reference< awt::XWindow > > oldDockingAreaWindows;
......@@ -1264,7 +1264,7 @@ throw ( RuntimeException, std::exception )
ToolbarLayoutManager* pToolbarManager = m_pToolbarManager;
if ( !xDockingAreaAcceptor.is() )
m_aAsyncLayoutIdle.Stop();
m_aAsyncLayoutTimer.Stop();
// Remove listener from old docking area acceptor
if ( m_xDockingAreaAcceptor.is() )
......@@ -2265,7 +2265,7 @@ throw (RuntimeException, std::exception)
SolarMutexClearableGuard aWriteLock;
if ( bDoLayout )
m_aAsyncLayoutIdle.Stop();
m_aAsyncLayoutTimer.Stop();
aWriteLock.clear();
Any a( nLockCount );
......@@ -2664,14 +2664,14 @@ throw( uno::RuntimeException, std::exception )
// application modules need this. So we have to check if this is the first
// call after the async layout time expired.
m_bMustDoLayout = true;
if ( !m_aAsyncLayoutIdle.IsActive() )
if ( !m_aAsyncLayoutTimer.IsActive() )
{
const Link& aLink = m_aAsyncLayoutIdle.GetTimeoutHdl();
const Link& aLink = m_aAsyncLayoutTimer.GetTimeoutHdl();
if ( aLink.IsSet() )
aLink.Call( &m_aAsyncLayoutIdle );
aLink.Call( &m_aAsyncLayoutTimer );
}
if ( m_nLockCount == 0 )
m_aAsyncLayoutIdle.Start();
m_aAsyncLayoutTimer.Start();
}
else if ( m_xFrame.is() && aEvent.Source == m_xFrame->getContainerWindow() )
{
......@@ -2741,7 +2741,7 @@ void SAL_CALL LayoutManager::windowHidden( const lang::EventObject& aEvent ) thr
IMPL_LINK_NOARG(LayoutManager, AsyncLayoutHdl)
{
SolarMutexClearableGuard aReadLock;
m_aAsyncLayoutIdle.Stop();
m_aAsyncLayoutTimer.Stop();
if( !m_xContainerWindow.is() )
return 0;
......
......@@ -235,15 +235,15 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext,
aHelpIdAsString += OUStringToOString( aToolbarName, RTL_TEXTENCODING_UTF8 );;
m_pToolBar->SetHelpId( aHelpIdAsString );
m_aAsyncUpdateControllersIdle.SetPriority( VCL_IDLE_PRIORITY_MEDIUM );
m_aAsyncUpdateControllersIdle.SetIdleHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) );
m_aAsyncUpdateControllersTimer.SetTimeout( 50 );
m_aAsyncUpdateControllersTimer.SetTimeoutHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) );
SvtMiscOptions().AddListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) );
}
ToolBarManager::~ToolBarManager()
{
assert(!m_aAsyncUpdateControllersIdle.IsActive());
assert(!m_aAsyncUpdateControllersTimer.IsActive());
OSL_ASSERT( m_pToolBar == 0 );
OSL_ASSERT( !m_bAddedToTaskPaneList );
}
......@@ -477,7 +477,7 @@ throw ( RuntimeException, std::exception )
SolarMutexGuard g;
if ( Action.Action == FrameAction_CONTEXT_CHANGED )
{
m_aAsyncUpdateControllersIdle.Start();
m_aAsyncUpdateControllersTimer.Start();
}
}
......@@ -631,7 +631,7 @@ void SAL_CALL ToolBarManager::dispose() throw( RuntimeException, std::exception
// stop timer to prevent timer events after dispose
// do it last because other calls could restart timer in StateChanged()
m_aAsyncUpdateControllersIdle.Stop();
m_aAsyncUpdateControllersTimer.Stop();
m_bDisposed = true;
}
......@@ -1417,7 +1417,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
UpdateControllers();
else if ( m_pToolBar->IsReallyVisible() )
{
m_aAsyncUpdateControllersIdle.Start();
m_aAsyncUpdateControllersTimer.Start();
}
// Try to retrieve UIName from the container property set and set it as the title
......@@ -2053,12 +2053,12 @@ IMPL_LINK( ToolBarManager, StateChanged, StateChangedType*, pStateChangedType )
{
if ( m_pToolBar->IsReallyVisible() )
{
m_aAsyncUpdateControllersIdle.Start();
m_aAsyncUpdateControllersTimer.Start();
}
}
else if ( *pStateChangedType == StateChangedType::INITSHOW )
{
m_aAsyncUpdateControllersIdle.Start();
m_aAsyncUpdateControllersTimer.Start();
}
return 1;
}
......@@ -2113,7 +2113,7 @@ IMPL_LINK_NOARG(ToolBarManager, AsyncUpdateControllersHdl)
return 1;
// Request to update our controllers
m_aAsyncUpdateControllersIdle.Stop();
m_aAsyncUpdateControllersTimer.Stop();
UpdateControllers();
return 0;
......
......@@ -385,12 +385,14 @@ AutoTimer& AutoTimer::operator=( const AutoTimer& rTimer )
Idle::Idle()
: Timer()
{
mbIdle = true;
SetPriority(VCL_IDLE_PRIORITY_LOWEST);
}
Idle::Idle( IdlePriority ePriority )
: Timer()
{
mbIdle = true;
SetPriority( ePriority );
}
......@@ -434,6 +436,7 @@ void Idle::DoIdle()
maTimeoutHdl.Call( this );
}
Idle::~Idle()
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment