diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-26 12:45:28 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-26 12:45:28 +0000 |
commit | 88bec023f8e04e0f2f527e564b83f5c1f583c03b (patch) | |
tree | 5f0fb1f792db810c76ba45895196a0bfb0784de5 /framework/source | |
parent | ed2a2ab285d229f189dfc97e74c086e06886321c (diff) |
INTEGRATION: CWS fwk72 (1.34.14); FILE MERGED
2007/09/18 08:55:21 mav 1.34.14.2: RESYNC: (1.34-1.35); FILE MERGED
2007/08/01 11:06:17 cd 1.34.14.1: #i79981# Context menu commands must be processed asynchronously as they can lead to the destruction of the menus parent window
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 70e91db8a2b3..2c1532a6bc28 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -4,9 +4,9 @@ * * $RCSfile: toolbarmanager.cxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.36 $ * - * last change: $Author: hr $ $Date: 2007-08-01 11:09:39 $ + * last change: $Author: ihi $ $Date: 2007-11-26 13:45:28 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1871,27 +1871,25 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu ) case MENUITEM_TOOLBAR_DOCKTOOLBAR: { - Reference< XLayoutManager > xLayoutManager = getLayoutManagerFromFrame( m_xFrame ); - if ( xLayoutManager.is() ) - { - ::com::sun::star::awt::Point aPoint; - aPoint.X = aPoint.Y = LONG_MAX; - xLayoutManager->dockWindow( m_aResourceName, - DockingArea_DOCKINGAREA_DEFAULT, - aPoint ); - } + ExecuteInfo* pExecuteInfo = new ExecuteInfo; + + pExecuteInfo->aToolbarResName = m_aResourceName; + pExecuteInfo->nCmd = EXEC_CMD_DOCKTOOLBAR; + pExecuteInfo->xLayoutManager = getLayoutManagerFromFrame( m_xFrame ); + + Application::PostUserEvent( STATIC_LINK(0, ToolBarManager, ExecuteHdl_Impl), pExecuteInfo ); break; } case MENUITEM_TOOLBAR_DOCKALLTOOLBAR: { - Reference< XLayoutManager > xLayoutManager = getLayoutManagerFromFrame( m_xFrame ); - if ( xLayoutManager.is() ) - { - ::com::sun::star::awt::Point aPoint; - aPoint.X = aPoint.Y = LONG_MAX; - xLayoutManager->dockAllWindows( UIElementType::TOOLBAR ); - } + ExecuteInfo* pExecuteInfo = new ExecuteInfo; + + pExecuteInfo->aToolbarResName = m_aResourceName; + pExecuteInfo->nCmd = EXEC_CMD_DOCKALLTOOLBARS; + pExecuteInfo->xLayoutManager = getLayoutManagerFromFrame( m_xFrame ); + + Application::PostUserEvent( STATIC_LINK(0, ToolBarManager, ExecuteHdl_Impl), pExecuteInfo ); break; } @@ -2127,6 +2125,20 @@ IMPL_STATIC_LINK_NOINSTANCE( ToolBarManager, ExecuteHdl_Impl, ExecuteInfo*, pExe if ( pDockWin ) pDockWin->Close(); } + else if (( pExecuteInfo->nCmd == EXEC_CMD_DOCKTOOLBAR ) && + ( pExecuteInfo->xLayoutManager.is() )) + { + ::com::sun::star::awt::Point aPoint; + aPoint.X = aPoint.Y = LONG_MAX; + pExecuteInfo->xLayoutManager->dockWindow( pExecuteInfo->aToolbarResName, + DockingArea_DOCKINGAREA_DEFAULT, + aPoint ); + } + else if (( pExecuteInfo->nCmd == EXEC_CMD_DOCKALLTOOLBARS ) && + ( pExecuteInfo->xLayoutManager.is() )) + { + pExecuteInfo->xLayoutManager->dockAllWindows( UIElementType::TOOLBAR ); + } } catch ( Exception& ) { |