summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorJennifer Liebel <jliebel94@gmail.com>2014-11-06 11:52:02 +0000
committerTobias Madl <tobias.madl.dev@gmail.com>2014-12-09 12:34:51 +0000
commit18102201f4a68bc41f7caa21fc22ec761812b70b (patch)
tree92eeebc502ba9a332c3d3c020c1ace17aa7c0b02 /framework
parent93f5b9be9f4c01ac0d863a193f4ef33dfd194af0 (diff)
changed some timer to idle
Change-Id: If137dbd80f7260d9507e48709d3f0f14b60a25f6
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/services/layoutmanager.hxx4
-rw-r--r--framework/inc/uielement/toolbarmanager.hxx2
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx22
-rw-r--r--framework/source/uielement/toolbarmanager.cxx20
4 files changed, 21 insertions, 27 deletions
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 0dcfc4574404..12e9d30df44e 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -309,8 +309,8 @@ namespace framework
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState;
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowStateSupplier;
GlobalSettings* m_pGlobalSettings;
- OUString m_aModuleIdentifier;
- Timer m_aAsyncLayoutTimer;
+ OUString m_aModuleIdentifier;
+ Idle m_aAsyncLayoutIdle;
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; // container for ALL Listener
ToolbarLayoutManager* m_pToolbarManager;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener > m_xToolbarManager;
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 462f48ee8eb2..320aa7c7e1bc 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -208,7 +208,7 @@ class ToolBarManager : public ToolbarManager_Base
CommandToInfoMap m_aCommandMap;
SubToolBarToSubToolBarControllerMap m_aSubToolBarControllerMap;
- Timer m_aAsyncUpdateControllersTimer;
+ Idle m_aAsyncUpdateControllersIdle;
OUString m_sIconTheme;
MenuDescriptionMap m_aMenuMap;
bool m_bAcceleratorCfg;
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 245b5b07da36..d3969f2233fc 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -144,8 +144,8 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) :
Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) );
- m_aAsyncLayoutTimer.SetTimeout( 50 );
- m_aAsyncLayoutTimer.SetTimeoutHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) );
+ m_aAsyncLayoutIdle.SetPriority( VCL_IDLE_PRIORITY_RESIZE );
+ m_aAsyncLayoutIdle.SetIdleHdl( 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_aAsyncLayoutTimer.Stop();
+ m_aAsyncLayoutIdle.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_aAsyncLayoutTimer.Stop();
+ m_aAsyncLayoutIdle.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_aAsyncLayoutTimer.Stop();
+ m_aAsyncLayoutIdle.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_aAsyncLayoutTimer.Stop();
+ m_aAsyncLayoutIdle.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_aAsyncLayoutTimer.IsActive() )
+ if ( !m_aAsyncLayoutIdle.IsActive() )
{
- const Link& aLink = m_aAsyncLayoutTimer.GetTimeoutHdl();
+ const Link& aLink = m_aAsyncLayoutIdle.GetTimeoutHdl();
if ( aLink.IsSet() )
- aLink.Call( &m_aAsyncLayoutTimer );
+ aLink.Call( &m_aAsyncLayoutIdle );
}
if ( m_nLockCount == 0 )
- m_aAsyncLayoutTimer.Start();
+ m_aAsyncLayoutIdle.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_aAsyncLayoutTimer.Stop();
+ m_aAsyncLayoutIdle.Stop();
if( !m_xContainerWindow.is() )
return 0;
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index c9665323a1cc..5391ce4b83d8 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -235,8 +235,8 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext,
aHelpIdAsString += OUStringToOString( aToolbarName, RTL_TEXTENCODING_UTF8 );;
m_pToolBar->SetHelpId( aHelpIdAsString );
- m_aAsyncUpdateControllersTimer.SetTimeout( 50 );
- m_aAsyncUpdateControllersTimer.SetTimeoutHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) );
+ m_aAsyncUpdateControllersIdle.SetPriority( VCL_IDLE_PRIORITY_MEDIUM );
+ m_aAsyncUpdateControllersIdle.SetIdleHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) );
SvtMiscOptions().AddListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) );
}
@@ -476,9 +476,7 @@ throw ( RuntimeException, std::exception )
{
SolarMutexGuard g;
if ( Action.Action == FrameAction_CONTEXT_CHANGED )
- {
- m_aAsyncUpdateControllersTimer.Start();
- }
+ m_aAsyncUpdateControllersIdle.Start();
}
void SAL_CALL ToolBarManager::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
@@ -1416,9 +1414,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
if( m_pToolBar->WillUsePopupMode() )
UpdateControllers();
else if ( m_pToolBar->IsReallyVisible() )
- {
- m_aAsyncUpdateControllersTimer.Start();
- }
+ m_aAsyncUpdateControllersIdle.Start();
// Try to retrieve UIName from the container property set and set it as the title
// if it is not empty.
@@ -2052,13 +2048,11 @@ IMPL_LINK( ToolBarManager, StateChanged, StateChangedType*, pStateChangedType )
else if ( *pStateChangedType == StateChangedType::VISIBLE )
{
if ( m_pToolBar->IsReallyVisible() )
- {
- m_aAsyncUpdateControllersTimer.Start();
- }
+ m_aAsyncUpdateControllersIdle.Start();
}
else if ( *pStateChangedType == StateChangedType::INITSHOW )
{
- m_aAsyncUpdateControllersTimer.Start();
+ m_aAsyncUpdateControllersIdle.Start();
}
return 1;
}
@@ -2113,7 +2107,7 @@ IMPL_LINK_NOARG(ToolBarManager, AsyncUpdateControllersHdl)
return 1;
// Request to update our controllers
- m_aAsyncUpdateControllersTimer.Stop();
+ m_aAsyncUpdateControllersIdle.Stop();
UpdateControllers();
return 0;