Use SolarMutexGuard where appropriate

This commit is contained in:
Norbert Thiebaud 2010-10-14 16:43:16 -05:00
parent f4f4a8ed4f
commit dbd5e19301
6 changed files with 22 additions and 23 deletions

View file

@ -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();
}

View file

@ -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() )

View file

@ -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 ) &&

View file

@ -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;
aSolarGuard.clear();
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);
}
}
// <- 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 ) &&

View file

@ -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() );

View file

@ -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);