diff options
Diffstat (limited to 'framework/source/layoutmanager/toolbarlayoutmanager.cxx')
-rwxr-xr-x | framework/source/layoutmanager/toolbarlayoutmanager.cxx | 93 |
1 files changed, 47 insertions, 46 deletions
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 5f48a31393..8d4f643804 100755 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -302,7 +302,7 @@ Rectangle ToolbarLayoutManager::implts_calcDockingArea() uno::Reference< awt::XDockableWindow > xDockWindow( xWindow, uno::UNO_QUERY ); if ( xWindow.is() && xDockWindow.is() ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && !xDockWindow->isFloating() && pConstIter->m_bVisible ) @@ -556,7 +556,7 @@ bool ToolbarLayoutManager::showToolbar( const ::rtl::OUString& rResourceURL ) { UIElement aUIElement = implts_findToolbar( rResourceURL ); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = getWindowFromXUIElement( aUIElement.m_xUIElement ); if ( pWindow ) { @@ -578,7 +578,7 @@ bool ToolbarLayoutManager::hideToolbar( const ::rtl::OUString& rResourceURL ) { UIElement aUIElement = implts_findToolbar( rResourceURL ); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = getWindowFromXUIElement( aUIElement.m_xUIElement ); if ( pWindow ) { @@ -609,7 +609,7 @@ void ToolbarLayoutManager::refreshToolbarsVisibility( bool bAutomaticToolbars ) implts_getUIElementVectorCopy( aUIElementVector ); UIElement aUIElement; - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; UIElementVector::iterator pIter; for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); pIter++ ) { @@ -632,7 +632,7 @@ void ToolbarLayoutManager::setFloatingToolbarsVisibility( bool bVisible ) UIElementVector aUIElementVector; implts_getUIElementVectorCopy( aUIElementVector ); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; UIElementVector::iterator pIter; for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); pIter++ ) { @@ -655,7 +655,7 @@ void ToolbarLayoutManager::setVisible( bool bVisible ) UIElementVector aUIElementVector; implts_getUIElementVectorCopy( aUIElementVector ); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; UIElementVector::iterator pIter; for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); pIter++ ) { @@ -704,7 +704,7 @@ bool ToolbarLayoutManager::dockToolbar( const ::rtl::OUString& rResourceURL, ui: ToolBox* pToolBox( 0 ); { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { @@ -722,7 +722,7 @@ bool ToolbarLayoutManager::dockToolbar( const ::rtl::OUString& rResourceURL, ui: // we have to find a good place for it. ::Size aSize; - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; { if ( pToolBox ) aSize = pToolBox->CalcWindowSizePixel( 1, ImplConvertAlignment( aUIElement.m_aDockedData.m_nDockedArea ) ); @@ -906,7 +906,7 @@ void ToolbarLayoutManager::setParentWindow( if ( xParentWindow.is() ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::DockingAreaWindow* pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xTopDockWindow ) ); if( pWindow ) pWindow->SetAlign( WINDOWALIGN_TOP ); pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xBottomDockWindow ) ); @@ -1036,7 +1036,7 @@ void ToolbarLayoutManager::implts_createAddonsToolBars() if ( xWindow.is() ) { // Set generic title for add-on toolbar - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow->GetText().Len() == 0 ) pWindow->SetText( aGenericAddonTitle ); @@ -1185,7 +1185,7 @@ void ToolbarLayoutManager::implts_createCustomToolBar( const rtl::OUString& aTbx if ( aTitle && xUIElement.is() ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = getWindowFromXUIElement( xUIElement ); if ( pWindow ) @@ -1205,7 +1205,7 @@ void ToolbarLayoutManager::implts_reparentToolbars() Window* pRightDockWindow = VCLUnoHelper::GetWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_RIGHT] ); aWriteLock.unlock(); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pContainerWindow ) { UIElementVector::iterator pIter; @@ -1326,7 +1326,7 @@ void ToolbarLayoutManager::implts_createToolBar( const ::rtl::OUString& aName, b // set toolbar menu style according to customize command state SvtCommandOptions aCmdOptions; - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { @@ -1388,7 +1388,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno if ( xDockWindow.is() && xWindow.is() ) { { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow ) { @@ -1414,7 +1414,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno { if ( pWindow ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; String aText = pWindow->GetText(); if ( aText.Len() == 0 ) pWindow->SetText( rElement.m_aUIName ); @@ -1441,7 +1441,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno if( pToolBox ) { // set an optimal initial floating size - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::Size aSize( pToolBox->CalcFloatingWindowSizePixel() ); pToolBox->SetOutputSizePixel( aSize ); } @@ -1461,7 +1461,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno implts_writeWindowStateData( rElement ); if ( bShowElement && pWindow ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pWindow->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } } @@ -1474,7 +1474,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno if ( pToolBox ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pToolBox->SetAlign( ImplConvertAlignment(rElement.m_aDockedData.m_nDockedArea ) ); pToolBox->SetLineCount( 1 ); xDockWindow->setFloatingMode( sal_False ); @@ -1495,8 +1495,8 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno xWindow->setOutputSize( AWTSize( aSize) ); if ( pWindow ) - { - vos::OGuard aGuard( Application::GetSolarMutex() ); + { + SolarMutexGuard aGuard; if ( !bShowElement ) pWindow->Hide(); } @@ -1914,7 +1914,7 @@ void ToolbarLayoutManager::implts_setToolbar( const UIElement& rUIElement ) Window* pContainerWindow( 0 ); if ( xContainerWindow.is() ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); if ( pContainerWindow ) aStartPos = pContainerWindow->OutputToScreenPixel( aStartPos ); @@ -1938,7 +1938,7 @@ void ToolbarLayoutManager::implts_setToolbar( const UIElement& rUIElement ) uno::Reference< awt::XWindow > xWindow( xDockWindow, uno::UNO_QUERY ); if ( xDockWindow.is() && xDockWindow->isFloating() ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->IsVisible() ) { @@ -2209,7 +2209,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D uno::Reference< awt::XWindow > xWindow( xUIElement->getRealInterface(), uno::UNO_QUERY ); if ( xWindow.is() ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); uno::Reference< awt::XDockableWindow > xDockWindow( xWindow, uno::UNO_QUERY ); if ( pWindow && pIter->m_bVisible && xDockWindow.is() && !pIter->m_bFloating ) @@ -2313,7 +2313,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D aReadLock.unlock(); // Calc correct position of the column/row rectangle to be able to compare it with mouse pos/tracking rect - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // Retrieve output size from container Window if ( pDockingAreaWindow && pContainerWindow ) @@ -2414,7 +2414,7 @@ void ToolbarLayoutManager::implts_findNextDockingPos( ui::DockingArea DockingAre { // Retrieve output size from container Window - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pDockingWindow = VCLUnoHelper::GetWindow( xDockingWindow ); if ( pDockingWindow ) aDockingWinSize = pDockingWindow->GetOutputSizePixel(); @@ -2629,7 +2629,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( awt::Rectangle& rWinRect = rRowColumnWindowData.aRowColumnWindowSizes[i]; ::Size aMinSize; - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; { uno::Reference< awt::XWindow > xWindow = rRowColumnWindowData.aRowColumnWindows[i]; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); @@ -2690,7 +2690,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nCurrPos( 0 ); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; for ( sal_uInt32 i = 0; i < nCount; i++ ) { uno::Reference< awt::XWindow > xWindow = rRowColumnWindowData.aRowColumnWindows[i]; @@ -2765,7 +2765,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( { // Retrieve output size from container Window - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); aContainerWinSize = pContainerWindow->GetOutputSizePixel(); } @@ -2793,7 +2793,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( aReadLock.unlock(); { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pDockingAreaWindow = VCLUnoHelper::GetWindow( xDockingAreaWindow ); pDockWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pDockWindow && pDockWindow->GetType() == WINDOW_TOOLBOX ) @@ -2845,7 +2845,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( { // Calc correct position of the column/row rectangle to be able to compare it with mouse pos/tracking rect - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; aRect.SetPos( pContainerWindow->ScreenToOutputPixel( pDockingAreaWindow->OutputToScreenPixel( aRect.TopLeft() ))); } @@ -2944,7 +2944,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( // Set virtual position sal_Int32 nPosY( 0 ); { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; nPosY = pDockingAreaWindow->ScreenToOutputPixel( pContainerWindow->OutputToScreenPixel( aWindowRect.BottomRight() )).Y(); } @@ -3068,7 +3068,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( rTrackingRect.setWidth( nSize ); { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; nPosX = pDockingAreaWindow->ScreenToOutputPixel( pContainerWindow->OutputToScreenPixel( rTrackingRect.TopLeft() )).X(); } @@ -3114,7 +3114,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( rTrackingRect.setHeight( nSize ); { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; nPosY = pDockingAreaWindow->ScreenToOutputPixel( pContainerWindow->OutputToScreenPixel( rTrackingRect.TopLeft() )).Y(); } @@ -3229,7 +3229,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d Window* pDockingAreaWindow( 0 ); Window* pContainerWindow( 0 ); { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pDockingAreaWindow = VCLUnoHelper::GetWindow( xDockingAreaWindow ); pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); nDockPosY = pDockingAreaWindow->ScreenToOutputPixel( pContainerWindow->OutputToScreenPixel( ::Point( 0, nPosY ))).Y(); @@ -3423,7 +3423,7 @@ throw (uno::RuntimeException) Window* pWindow( 0 ); ::Point aMousePos; { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); aMousePos = pContainerWindow->ScreenToOutputPixel( ::Point( e.MousePos.X, e.MousePos.Y )); } @@ -3444,7 +3444,8 @@ throw (uno::RuntimeException) aUIElement.m_aFloatingData.m_aPos = ::Point( aPos.X, aPos.Y ); aUIElement.m_aFloatingData.m_aSize = ::Size( aSize.Width, aSize.Height ); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; + pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { @@ -3490,7 +3491,7 @@ throw (uno::RuntimeException) { try { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; sal_Int16 eDockingArea( -1 ); // none sal_Int32 nMagneticZone( aUIDockingElement.m_bFloating ? MAGNETIC_DISTANCE_DOCK : MAGNETIC_DISTANCE_UNDOCK ); @@ -3693,7 +3694,7 @@ throw (uno::RuntimeException) if ( bDockingInProgress ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = VCLUnoHelper::GetWindow( uno::Reference< awt::XWindow >( e.Source, uno::UNO_QUERY )); ToolBox* pToolBox = 0; if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) @@ -3755,7 +3756,7 @@ throw (uno::RuntimeException) if ( xDockWindow->isFloating() ) { { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { @@ -3793,7 +3794,7 @@ throw (uno::RuntimeException) uno::Reference< awt::XWindow2 > xWindow; { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; xWindow = uno::Reference< awt::XWindow2 >( e.Source, uno::UNO_QUERY ); pWindow = VCLUnoHelper::GetWindow( xWindow ); @@ -3814,7 +3815,7 @@ throw (uno::RuntimeException) implts_setLayoutInProgress( true ); if ( aUIDockingElement.m_bFloating ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pToolBox ) { pToolBox->SetLineCount( aUIDockingElement.m_aFloatingData.m_nLines ); @@ -3854,7 +3855,7 @@ throw (uno::RuntimeException) ::Size aSize; { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pToolBox ) aSize = pToolBox->CalcWindowSizePixel( 1, ImplConvertAlignment( aUIDockingElement.m_aDockedData.m_nDockedArea ) ); else @@ -3865,7 +3866,7 @@ throw (uno::RuntimeException) aUIDockingElement.m_aDockedData.m_aPos = aDockPos; } - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pToolBox ) { pToolBox->SetAlign( ImplConvertAlignment( aUIDockingElement.m_aDockedData.m_nDockedArea) ); @@ -3892,7 +3893,7 @@ throw (uno::RuntimeException) } else { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pToolBox ) { if ( aUIDockingElement.m_bFloating ) @@ -4001,7 +4002,7 @@ throw (uno::RuntimeException) catch ( lang::WrappedTargetException& ) {} { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Window* pWindow = getWindowFromXUIElement( xUIElement ); if ( pWindow ) pWindow->SetText( aUIName ); @@ -4226,7 +4227,7 @@ awt::Size ToolbarLayoutManager::getToolbarSize( const ::rtl::OUString& rResource { Window* pWindow = implts_getWindow( rResourceURL ); - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pWindow ) { ::Size aSize = pWindow->GetSizePixel(); |