diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-10-14 16:43:16 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-10-25 19:55:33 -0500 |
commit | dbd5e19301cfae96600724cfdcfa004a08b50afd (patch) | |
tree | a5d9d886eb967df2e3842d51a902486dcf446e98 | |
parent | f4f4a8ed4f56035cc9f536d00f62a552af974cf0 (diff) |
Use SolarMutexGuard where appropriate
-rw-r--r-- | basic/source/classes/eventatt.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 10 | ||||
-rw-r--r-- | framework/source/dispatch/closedispatcher.cxx | 2 | ||||
-rw-r--r-- | framework/source/inc/pattern/window.hxx | 27 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/recoveryui.cxx | 2 |
6 files changed, 22 insertions, 23 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 8b2e83badfad..37b8037bf9e3 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -255,7 +255,7 @@ Any BasicScriptListener_Impl::approveFiring( const ScriptEvent& aScriptEvent ) void BasicScriptListener_Impl::disposing(const EventObject& ) throw ( RuntimeException ) { // TODO: ??? - //NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + //SolarMutexGuard aGuard; //xSbxObj.Clear(); } diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 2158bdc8ef38..e22cb142f0ca 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -3905,7 +3905,7 @@ BasicAllListener_Impl::~BasicAllListener_Impl() void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + SolarMutexGuard guard; if( xSbxObj.Is() ) { @@ -3970,7 +3970,7 @@ Any BasicAllListener_Impl::approveFiring( const AllEventObject& Event ) throw ( // Methods of XEventListener void BasicAllListener_Impl ::disposing(const EventObject& ) throw ( RuntimeException ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + SolarMutexGuard guard; xSbxObj.Clear(); } @@ -4344,7 +4344,7 @@ void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty, if( !m_bProxyIsClassModuleObject ) throw UnknownPropertyException(); - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + SolarMutexGuard guard; ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Set ") ); aPropertyFunctionName += m_aPrefix; @@ -4385,7 +4385,7 @@ Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty ) if( !m_bProxyIsClassModuleObject ) throw UnknownPropertyException(); - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + SolarMutexGuard guard; ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Get ") ); aPropertyFunctionName += m_aPrefix; @@ -4423,7 +4423,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction, Sequence< Any >& ) throw( CannotConvertException, InvocationTargetException ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + SolarMutexGuard guard; Any aRet; if( !m_xScopeObj.Is() ) diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index 25f8f0f005b6..693bda1e07df 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -630,7 +630,7 @@ css::uno::Reference< css::frame::XFrame > CloseDispatcher::static_impl_searchRig // Attention ! Checking Window->GetParent() isnt the right approach here. // Because sometimes VCL create "implicit border windows" as parents even we created // a simple XWindow using the toolkit only .-( - ::vos::OGuard aSolarLock(&Application::GetSolarMutex()); + SolarMutexGuard aSolarLock; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( (pWindow ) && diff --git a/framework/source/inc/pattern/window.hxx b/framework/source/inc/pattern/window.hxx index c185e5644348..0741a35d2018 100644 --- a/framework/source/inc/pattern/window.hxx +++ b/framework/source/inc/pattern/window.hxx @@ -71,20 +71,20 @@ static ::rtl::OUString getWindowState(const css::uno::Reference< css::awt::XWind if (!xWindow.is()) return ::rtl::OUString(); - // SOLAR SAFE -> ---------------------------- - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); - ByteString sWindowState; - Window* pWindow = VCLUnoHelper::GetWindow(xWindow); - // check for system window is neccessary to guarantee correct pointer cast! - if (pWindow!=NULL && pWindow->IsSystemWindow()) + // SOLAR SAFE -> ---------------------------- { - ULONG nMask = WINDOWSTATE_MASK_ALL; - nMask &= ~(WINDOWSTATE_MASK_MINIMIZED); - sWindowState = ((SystemWindow*)pWindow)->GetWindowState(nMask); + SolarMutexGuard aSolarGuard; + + Window* pWindow = VCLUnoHelper::GetWindow(xWindow); + // check for system window is neccessary to guarantee correct pointer cast! + if (pWindow!=NULL && pWindow->IsSystemWindow()) + { + ULONG nMask = WINDOWSTATE_MASK_ALL; + nMask &= ~(WINDOWSTATE_MASK_MINIMIZED); + sWindowState = ((SystemWindow*)pWindow)->GetWindowState(nMask); + } } - - aSolarGuard.clear(); // <- SOLAR SAFE ---------------------------- return B2U_ENC(sWindowState,RTL_TEXTENCODING_UTF8); @@ -101,7 +101,7 @@ static void setWindowState(const css::uno::Reference< css::awt::XWindow >& xWind return; // SOLAR SAFE -> ---------------------------- - ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow(xWindow); // check for system window is neccessary to guarantee correct pointer cast! @@ -118,7 +118,6 @@ static void setWindowState(const css::uno::Reference< css::awt::XWindow >& xWind ((SystemWindow*)pWindow)->SetWindowState(U2B_ENC(sWindowState,RTL_TEXTENCODING_UTF8)); } - aSolarGuard.clear(); // <- SOLAR SAFE ---------------------------- } @@ -134,7 +133,7 @@ static ::sal_Bool isTopWindow(const css::uno::Reference< css::awt::XWindow >& xW // Attention ! Checking Window->GetParent() isnt the right approach here. // Because sometimes VCL create "implicit border windows" as parents even we created // a simple XWindow using the toolkit only .-( - ::vos::OGuard aSolarLock(&Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( (pWindow ) && diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index f94037909ef8..73fa53b6a3d6 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -293,7 +293,7 @@ static sal_Bool implts_isFrameOrWindowTop( const css::uno::Reference< css::frame if (xWindowCheck.is()) { // --> PB 2007-06-18 #i76867# top and system window is required. - ::vos::OGuard aSolarLock(&Application::GetSolarMutex()); + SolarMutexGuard aGuard; css::uno::Reference< css::awt::XWindow > xWindow( xWindowCheck, UNO_QUERY ); Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); return ( pWindow && pWindow->IsSystemWindow() ); diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 4fd41c5d68fe..43d0bac31849 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -110,7 +110,7 @@ css::uno::Any SAL_CALL RecoveryUI::dispatchWithReturnValue(const css::util::URL& { // Internaly we use VCL ... every call into vcl based code must // be guarded by locking the global solar mutex. - ::vos::OGuard aSolarLock(&Application::GetSolarMutex()); + SolarMutexGuard aSolarLock; css::uno::Any aRet; RecoveryUI::EJob eJob = impl_classifyJob(aURL); |