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 | 0e31314d93662fe0f6173a4010f140cfcc34b25f (patch) | |
tree | 070ebfed4f6c5210e5bc443162ad50b28fd7ffe0 /framework/source/inc | |
parent | 64bf274cc9d5d73e2a86861f585257f76105ce3e (diff) |
Use SolarMutexGuard where appropriate
Diffstat (limited to 'framework/source/inc')
-rw-r--r-- | framework/source/inc/pattern/window.hxx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/framework/source/inc/pattern/window.hxx b/framework/source/inc/pattern/window.hxx index a1fa0af0ec..2a9bbec451 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,8 +101,8 @@ 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! if ( @@ -114,11 +114,10 @@ static void setWindowState(const css::uno::Reference< css::awt::XWindow >& xWind (!((WorkWindow*)pWindow)->IsMinimized() ) ) ) - { + { ((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 ) && |