summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-10-14 16:43:53 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-10-25 19:55:37 -0500
commit7223ecb528c9883bae835ae5b47f7306efa2e256 (patch)
tree03715319790af474ba8305c0806e89cb2f95bf5d
parent18a9a87a805b94ad8f7b8a67d63a8568bfd295e7 (diff)
Use SolarMutexGuard where appropriate
-rw-r--r--svtools/source/misc/ehdl.cxx6
-rw-r--r--svtools/source/uno/contextmenuhelper.cxx12
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx18
-rw-r--r--toolkit/source/controls/unocontrol.cxx4
-rw-r--r--vcl/source/app/svapp.cxx10
-rw-r--r--vcl/source/app/svmain.cxx2
7 files changed, 27 insertions, 27 deletions
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index cdff8f2916bb..c12b827ed253 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -62,7 +62,7 @@ static USHORT aWndFunc(
{
- NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// aus den Flags die benoetigten WinBits ermitteln
WinBits eBits=0;
@@ -375,7 +375,7 @@ BOOL SfxErrorHandler::GetErrorString(
*/
{
- NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
BOOL bRet = FALSE;
rStr=String(SvtResId(RID_ERRHDL_CLASS));
@@ -452,7 +452,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
}
if( pMgr )
{
- NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
ResId aResId( nResId, *pMgr );
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
index 121e3934b2d0..6c8239c88895 100644
--- a/svtools/source/uno/contextmenuhelper.cxx
+++ b/svtools/source/uno/contextmenuhelper.cxx
@@ -139,7 +139,7 @@ void SAL_CALL StateEventHelper::disposing(
const lang::EventObject& )
throw ( uno::RuntimeException )
{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
m_xDispatchProvider.clear();
m_xURLTransformer.clear();
m_aCondition.set();
@@ -149,7 +149,7 @@ void SAL_CALL StateEventHelper::statusChanged(
const frame::FeatureStateEvent& Event )
throw ( uno::RuntimeException )
{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
m_bCurrentCommandEnabled = Event.IsEnabled;
m_aCondition.set();
}
@@ -163,7 +163,7 @@ bool StateEventHelper::isCommandEnabled()
uno::Reference< frame::XDispatch > xDispatch;
util::URL aTargetURL;
{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
if ( m_xDispatchProvider.is() && m_xURLTransformer.is() )
{
::rtl::OUString aSelf( RTL_CONSTASCII_USTRINGPARAM( "_self" ));
@@ -205,7 +205,7 @@ bool StateEventHelper::isCommandEnabled()
{
}
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
bResult = m_bCurrentCommandEnabled;
}
@@ -277,7 +277,7 @@ ContextMenuHelper::completeAndExecute(
const Point& aPos,
PopupMenu& rPopupMenu )
{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
associateUIConfigurationManagers();
completeMenuProperties( &rPopupMenu );
@@ -290,7 +290,7 @@ ContextMenuHelper::completeAndExecute(
const Point& aPos,
const uno::Reference< awt::XPopupMenu >& xPopupMenu )
{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
VCLXMenu* pXMenu = VCLXMenu::GetImplementation( xPopupMenu );
if ( pXMenu )
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index b88cea692ef4..ae8bc088f2e3 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -110,7 +110,7 @@ void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags )
{
if(mpOutputDevice)
{
- NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
if ( nFlags & INITOUTDEV_FONT )
{
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 9374d1aae336..3a80494bb979 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -441,8 +441,8 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
if( bInitedByVCLToolkit )
{
{
- osl::Guard< vos::IMutex > aGuard( Application::GetSolarMutex() );
- Application::Execute();
+ SolarMutexGuard aGuard;
+ Application::Execute();
}
try
{
@@ -596,7 +596,7 @@ void SAL_CALL VCLXToolkit::disposing()
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > xRef;
VCLXVirtualDevice* pVDev = new VCLXVirtualDevice;
- osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
VirtualDevice* pV = new VirtualDevice;
pV->SetOutputSizePixel( Size( Width, Height ) );
@@ -656,7 +656,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
if ( nType )
{
- NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
switch ( (WindowType)nType )
{
case WINDOW_CANCELBUTTON:
@@ -1011,7 +1011,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xRef;
@@ -1165,7 +1165,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
#elif defined OS2
aParentData.hWnd = (HWND)nWindowHandle;
#endif
- osl::Guard< vos::IMutex > aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
try
{
pChildWindow = new WorkWindow( &aParentData );
@@ -1183,7 +1183,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
}
else if (nSystemType == com::sun::star::lang::SystemDependent::SYSTEM_JAVA)
{
- osl::Guard< vos::IMutex > aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
pChildWindow = new WorkWindow(0, Parent);
}
@@ -1191,7 +1191,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
if ( pChildWindow )
{
VCLXTopWindow* pPeer = new VCLXTopWindow(true);
- osl::Guard< vos::IMutex > aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
pPeer->SetWindow( pChildWindow );
xPeer = pPeer;
}
@@ -1258,7 +1258,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
Window * pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow )
{
- osl::Guard< vos::IMutex > aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
xMsgBox->setCaptionText( aTitle );
xMsgBox->setMessageText( aMessage );
}
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 8286bd3d203b..872b80be1e32 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -219,7 +219,7 @@ Reference< XWindowPeer > UnoControl::ImplGetCompatiblePeer( sal_Bool bAcceptE
WorkWindow* pWW;
{
- osl::Guard< vos::IMutex > aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
pWW = lcl_GetDefaultWindow();
}
try
@@ -652,7 +652,7 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent
// #82300# - 2000-12-21 - fs@openoffice.org
if (bNeedNewPeer && xParent.is())
{
- NAMESPACE_VOS(OGuard) aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
// and now this is the final withdrawal:
// With 83561, I have no other idea than locking the SolarMutex here ....
// I really hate the fact that VCL is not theadsafe ....
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index e6d5aae960ad..cef68ca7ea1d 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -923,7 +923,7 @@ BOOL Application::HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
ULONG Application::PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
ULONG nEventId = 0;
if( pWin && pKeyEvent )
@@ -950,7 +950,7 @@ ULONG Application::PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent
ULONG Application::PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMouseEvent )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
ULONG nEventId = 0;
if( pWin && pMouseEvent )
@@ -985,7 +985,7 @@ ULONG Application::PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMous
IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData );
const void* pEventData;
ULONG nEvent;
@@ -1048,7 +1048,7 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
void Application::RemoveMouseAndKeyEvents( Window* pWin )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
// remove all events for specific window, watch for destruction of internal data
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
@@ -1072,7 +1072,7 @@ void Application::RemoveMouseAndKeyEvents( Window* pWin )
BOOL Application::IsProcessedMouseOrKeyEvent( ULONG nEventId )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
// find event
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index a6c26caabd1b..ea8396e9f91b 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -133,7 +133,7 @@ oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo
{
bIn = true;
- ::vos::OGuard aLock(&Application::GetSolarMutex());
+ SolarMutexGuard aLock;
// Timer nicht mehr anhalten, da ansonsten die UAE-Box
// auch nicht mehr gepaintet wird