summaryrefslogtreecommitdiff
path: root/framework/source/helper
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-10-14 22:09:00 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-10-25 19:55:33 -0500
commit4bd2ed6a919c1c970dda6e9f58b813d6b59a6eb5 (patch)
tree110fd94c216b47976a99ff070376aa352222948f /framework/source/helper
parentdbd5e19301cfae96600724cfdcfa004a08b50afd (diff)
convert OClearableGuard(SolarMutex) to SolarMutex(Clearable)Guard.
Most OClearableGuard of the Solar Mutex could be converted to a simple SolarMutexGuard. a couple of site were converted to a SolarMutexClearableGuard, were converting to a SolarMutexGuard would have made the code more convoluted.
Diffstat (limited to 'framework/source/helper')
-rw-r--r--framework/source/helper/persistentwindowstate.cxx8
-rw-r--r--framework/source/helper/statusindicatorfactory.cxx2
-rw-r--r--framework/source/helper/tagwindowasmodified.cxx4
-rw-r--r--framework/source/helper/titlebarupdate.cxx8
-rw-r--r--framework/source/helper/vclstatusindicator.cxx66
5 files changed, 40 insertions, 48 deletions
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 ----------------------------
}