diff options
-rw-r--r-- | framework/source/dispatch/windowcommanddispatch.cxx | 14 | ||||
-rw-r--r-- | framework/source/helper/persistentwindowstate.cxx | 8 | ||||
-rw-r--r-- | framework/source/helper/statusindicatorfactory.cxx | 2 | ||||
-rw-r--r-- | framework/source/helper/tagwindowasmodified.cxx | 4 | ||||
-rw-r--r-- | framework/source/helper/titlebarupdate.cxx | 8 | ||||
-rw-r--r-- | framework/source/helper/vclstatusindicator.cxx | 66 | ||||
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 12 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 21 | ||||
-rw-r--r-- | framework/source/services/taskcreatorsrv.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/fmscriptingenv.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmundo.cxx | 8 |
13 files changed, 72 insertions, 82 deletions
diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx index dd88cf890622..7138f2656cc8 100644 --- a/framework/source/dispatch/windowcommanddispatch.cxx +++ b/framework/source/dispatch/windowcommanddispatch.cxx @@ -106,15 +106,15 @@ void WindowCommandDispatch::impl_startListening() return; // SYNCHRONIZED -> - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); - - Window* pWindow = VCLUnoHelper::GetWindow(xWindow); - if ( ! pWindow) - return; + { + SolarMutexGuard aSolarLock; - pWindow->AddEventListener( LINK(this, WindowCommandDispatch, impl_notifyCommand) ); + Window* pWindow = VCLUnoHelper::GetWindow(xWindow); + if ( ! pWindow) + return; - aSolarLock.clear(); + pWindow->AddEventListener( LINK(this, WindowCommandDispatch, impl_notifyCommand) ); + } // <- SYNCHRONIZED } diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx index d0d21d384936..de582de5a145 100644 --- a/framework/source/helper/persistentwindowstate.cxx +++ b/framework/source/helper/persistentwindowstate.cxx @@ -285,7 +285,7 @@ void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Refere if (xWindow.is()) { // SOLAR SAFE -> ------------------------ - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow(xWindow); // check for system window is neccessary to guarantee correct pointer cast! @@ -300,8 +300,6 @@ void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Refere ((SystemWindow*)pWindow)->GetWindowState(nMask), RTL_TEXTENCODING_UTF8); } - - aSolarLock.clear(); // <- SOLAR SAFE ------------------------ } @@ -320,7 +318,7 @@ void PersistentWindowState::implst_setWindowStateOnWindow(const css::uno::Refere return; // SOLAR SAFE -> ------------------------ - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow(xWindow); if (!pWindow) @@ -341,8 +339,6 @@ void PersistentWindowState::implst_setWindowStateOnWindow(const css::uno::Refere return; pSystemWindow->SetWindowState(U2B_ENC(sWindowState,RTL_TEXTENCODING_UTF8)); - - aSolarLock.clear(); // <- SOLAR SAFE ------------------------ } diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 465e55c48285..c063fd34241b 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -428,7 +428,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() // is visible too. impl_showProgress(); - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow(xParentWindow); if ( pWindow ) { diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx index 3abda2a1400e..1ce45a0046ad 100644 --- a/framework/source/helper/tagwindowasmodified.cxx +++ b/framework/source/helper/tagwindowasmodified.cxx @@ -141,7 +141,7 @@ void SAL_CALL TagWindowAsModified::modified(const css::lang::EventObject& aEvent ::sal_Bool bModified = xModel->isModified (); // SYNCHRONIZED -> - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow(xWindow); if ( ! pWindow) @@ -156,8 +156,6 @@ void SAL_CALL TagWindowAsModified::modified(const css::lang::EventObject& aEvent pWindow->SetExtendedStyle(WB_EXT_DOCMODIFIED); else pWindow->SetExtendedStyle( ! WB_EXT_DOCMODIFIED); - - aSolarGuard.clear(); // <- SYNCHRONIZED } diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index fd2154f6f359..58b7d987d0fb 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -310,7 +310,7 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra // Check window pointer for right WorkWindow class too!!! // VCL SYNCHRONIZED -> - ::vos::OClearableGuard aSolarLock( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; Window* pWindow = (VCLUnoHelper::GetWindow( xWindow )); if ( @@ -327,8 +327,6 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra aURL = xModel->getURL(); pWorkWindow->SetRepresentedURL( aURL ); } - - aSolarLock.clear(); // <- VCL SYNCHRONIZED } @@ -347,7 +345,7 @@ void TitleBarUpdate::impl_updateTitle(const css::uno::Reference< css::frame::XFr const ::rtl::OUString sTitle = xTitle->getTitle (); // VCL SYNCHRONIZED -> - ::vos::OClearableGuard aSolarLock( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; Window* pWindow = (VCLUnoHelper::GetWindow( xWindow )); if ( @@ -358,8 +356,6 @@ void TitleBarUpdate::impl_updateTitle(const css::uno::Reference< css::frame::XFr WorkWindow* pWorkWindow = (WorkWindow*)pWindow; pWorkWindow->SetText( sTitle ); } - - aSolarLock.clear(); // <- VCL SYNCHRONIZED } diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx index d9861169d5cc..1578b3d45454 100644 --- a/framework/source/helper/vclstatusindicator.cxx +++ b/framework/source/helper/vclstatusindicator.cxx @@ -91,24 +91,24 @@ void SAL_CALL VCLStatusIndicator::start(const ::rtl::OUString& sText , // <- SAFE ---------------------------------- // SOLAR SAFE -> ---------------------------- - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); - - Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); - if (!m_pStatusBar) - m_pStatusBar = new StatusBar(pParentWindow, WB_3DLOOK|WB_BORDER); + { + SolarMutexGuard aSolarGuard; - VCLStatusIndicator::impl_recalcLayout(m_pStatusBar, pParentWindow); + Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); + if (!m_pStatusBar) + m_pStatusBar = new StatusBar(pParentWindow, WB_3DLOOK|WB_BORDER); - m_pStatusBar->Show(); - m_pStatusBar->StartProgressMode(sText); - m_pStatusBar->SetProgressValue(0); + VCLStatusIndicator::impl_recalcLayout(m_pStatusBar, pParentWindow); - // force repaint! - pParentWindow->Show(); - pParentWindow->Invalidate(INVALIDATE_CHILDREN); - pParentWindow->Flush(); + m_pStatusBar->Show(); + m_pStatusBar->StartProgressMode(sText); + m_pStatusBar->SetProgressValue(0); - aSolarLock.clear(); + // force repaint! + pParentWindow->Show(); + pParentWindow->Invalidate(INVALIDATE_CHILDREN); + pParentWindow->Flush(); + } // <- SOLAR SAFE ---------------------------- // SAFE -> ---------------------------------- @@ -125,13 +125,12 @@ void SAL_CALL VCLStatusIndicator::reset() throw(css::uno::RuntimeException) { // SOLAR SAFE -> ---------------------------- - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; if (m_pStatusBar) { m_pStatusBar->SetProgressValue(0); m_pStatusBar->SetText(String()); } - aSolarLock.clear(); // <- SOLAR SAFE ---------------------------- } @@ -148,16 +147,17 @@ void SAL_CALL VCLStatusIndicator::end() // <- SAFE ---------------------------------- // SOLAR SAFE -> ---------------------------- - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); - if (m_pStatusBar) { - m_pStatusBar->EndProgressMode(); - m_pStatusBar->Show(sal_False); - - delete m_pStatusBar; - m_pStatusBar = 0; + SolarMutexGuard aSolarGuard; + if (m_pStatusBar) + { + m_pStatusBar->EndProgressMode(); + m_pStatusBar->Show(sal_False); + + delete m_pStatusBar; + m_pStatusBar = 0; + } } - aSolarLock.clear(); // <- SOLAR SAFE ---------------------------- } @@ -172,10 +172,11 @@ void SAL_CALL VCLStatusIndicator::setText(const ::rtl::OUString& sText) // <- SAFE ---------------------------------- // SOLAR SAFE -> ---------------------------- - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); - if (m_pStatusBar) - m_pStatusBar->SetText(sText); - aSolarLock.clear(); + { + SolarMutexGuard aSolarGuard; + if (m_pStatusBar) + m_pStatusBar->SetText(sText); + } // <- SOLAR SAFE ---------------------------- } @@ -203,10 +204,11 @@ void SAL_CALL VCLStatusIndicator::setValue(sal_Int32 nValue) ((nValue*100) / ::std::max(nRange,(sal_Int32)1)), (sal_Int32)100)); // SOLAR SAFE -> ---------------------------- - ::vos::OClearableGuard aSolarLock(Application::GetSolarMutex()); - if (m_pStatusBar) - m_pStatusBar->SetProgressValue(nPercent); - aSolarLock.clear(); + { + SolarMutexGuard aSolarGuard; + if (m_pStatusBar) + m_pStatusBar->SetProgressValue(nPercent); + } // <- SOLAR SAFE ---------------------------- } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 26972b1cb3db..39314fe9d9af 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1639,7 +1639,7 @@ void LoadEnv::impl_reactForLoadingState() if (bMinimized) { - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow(xWindow); // check for system window is neccessary to guarantee correct pointer cast! if (pWindow && pWindow->IsSystemWindow()) @@ -1750,7 +1750,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X aReadLock.unlock(); // <- SAFE ---------------------------------- - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow(xWindow); if ( pWindow ) { @@ -1818,7 +1818,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw return; // SOLAR SAFE -> - ::vos::OClearableGuard aSolarLock1(Application::GetSolarMutex()); + SolarMutexClearableGuard aSolarGuard1; Window* pWindow = VCLUnoHelper::GetWindow(xWindow); if (!pWindow) @@ -1835,7 +1835,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw if (pWorkWindow->IsMinimized()) return; - aSolarLock1.clear(); + aSolarGuard1.clear(); // <- SOLAR SAFE // SAFE -> @@ -1877,7 +1877,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw if (sWindowState.getLength()) { // SOLAR SAFE -> - ::vos::OClearableGuard aSolarLock2(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; // We have to retrieve the window pointer again. Because nobody can guarantee // that the XWindow was not disposed inbetween .-) @@ -1890,8 +1890,6 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw SystemWindow* pSystemWindow = (SystemWindow*)pWindowCheck; pSystemWindow->SetWindowState(U2B_ENC(sWindowState,RTL_TEXTENCODING_UTF8)); - - aSolarLock2.clear(); // <- SOLAR SAFE } } diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index f0f1aaf6e661..7113181372bd 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -2304,7 +2304,7 @@ aEvent // Deactivation is always done implicitely by activation of another frame. // Only if no activation is done, deactivations have to be processed if the activated window // is a parent window of the last active Window! - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexClearableGuard aSolarGuard; // CheckMenuCloser_Impl(); Window* pFocusWindow = Application::GetFocusWindow(); if ( @@ -2910,17 +2910,18 @@ void Frame::implts_setIconOnWindow() // Don't forget SolarMutex! We use vcl directly :-( // Check window pointer for right WorkWindow class too!!! /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); - Window* pWindow = (VCLUnoHelper::GetWindow( xContainerWindow )); - if( - ( pWindow != NULL ) && - ( pWindow->GetType() == WINDOW_WORKWINDOW ) - ) { - WorkWindow* pWorkWindow = (WorkWindow*)pWindow; - pWorkWindow->SetIcon( (sal_uInt16)nIcon ); + SolarMutexGuard aSolarGuard; + Window* pWindow = (VCLUnoHelper::GetWindow( xContainerWindow )); + if( + ( pWindow != NULL ) && + ( pWindow->GetType() == WINDOW_WORKWINDOW ) + ) + { + WorkWindow* pWorkWindow = (WorkWindow*)pWindow; + pWorkWindow->SetIcon( (sal_uInt16)nIcon ); + } } - aSolarGuard.clear(); /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ } } diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index 02b030867be7..ac34efd1baa1 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -227,11 +227,10 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI void TaskCreatorService::implts_applyDocStyleToWindow(const css::uno::Reference< css::awt::XWindow >& xWindow) const { // SYNCHRONIZED -> - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pVCLWindow = VCLUnoHelper::GetWindow(xWindow); if (pVCLWindow) pVCLWindow->SetExtendedStyle(WB_EXT_DOCUMENT); - aSolarGuard.clear(); // <- SYNCHRONIZED } diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index e5f0d6b5f7de..75420ecfd2d3 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -471,7 +471,7 @@ void SfxDocTplService_Impl::init_Impl() if ( bNeedsUpdate ) { aGuard.clear(); - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexClearableGuard aSolarGuard; WaitWindow_Impl* pWin = new WaitWindow_Impl(); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index d4f7bc8f17a1..bbc4ddb0aa05 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1812,7 +1812,7 @@ ErrCode SfxObjectShell::CallStarBasicScript( const String& _rMacroName, const St const void* _pArguments, void* _pReturn ) { OSL_TRACE("in CallSBS"); - ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; // the arguments for the call SbxArrayRef xMacroArguments = lcl_translateUno2Basic( _pArguments ); @@ -1848,7 +1848,7 @@ ErrCode SfxObjectShell::CallScript( void *pRet ) { - ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ErrCode nErr = ERRCODE_NONE; if( rScriptType.EqualsAscii( "StarBasic" ) ) { diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index aab763dbd3b3..47184603eda7 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -492,7 +492,7 @@ namespace svxform //-------------------------------------------------------------------- void FormScriptingEnvironment::doFireScriptEvent( const ScriptEvent& _rEvent, Any* _pSyncronousResult ) { - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexClearableGuard aSolarGuard; ::osl::ClearableMutexGuard aGuard( m_aMutex ); if ( m_bDisposed ) diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index f75142dc6957..2fdd700b8ad2 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -754,7 +754,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt) // TODO: this is a potential race condition: two threads here could in theory // add their undo actions out-of-order - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; rModel.AddUndo(new FmUndoPropertyAction(rModel, evt)); } } @@ -776,7 +776,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt) void SAL_CALL FmXUndoEnvironment::elementInserted(const ContainerEvent& evt) throw(::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::elementInserted" ); - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); // neues Object zum lauschen @@ -802,7 +802,7 @@ void FmXUndoEnvironment::implSetModified() void SAL_CALL FmXUndoEnvironment::elementReplaced(const ContainerEvent& evt) throw(::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::elementReplaced" ); - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); Reference< XInterface > xIface; @@ -820,7 +820,7 @@ void SAL_CALL FmXUndoEnvironment::elementReplaced(const ContainerEvent& evt) thr void SAL_CALL FmXUndoEnvironment::elementRemoved(const ContainerEvent& evt) throw(::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::elementRemoved" ); - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); Reference< XInterface > xIface( evt.Element, UNO_QUERY ); |