summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-18 14:52:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-18 15:27:08 +0100
commit7cc2bb414c0ac42556cc5b11b8dbdad630927d78 (patch)
treea82c5ece5c231e4be44079eefa7007758565e1bf
parent309eba8c5d1d1c86aeba1122d3ad62e68e3deee5 (diff)
Use SolarMutexGuard directly
Change-Id: I58d52cfec21f2f93a6a17469bf31fc70d93c26a9
-rw-r--r--framework/inc/helper/titlebarupdate.hxx6
-rw-r--r--framework/source/helper/titlebarupdate.cxx41
2 files changed, 14 insertions, 33 deletions
diff --git a/framework/inc/helper/titlebarupdate.hxx b/framework/inc/helper/titlebarupdate.hxx
index 75e01193b697..d45082d4ccfc 100644
--- a/framework/inc/helper/titlebarupdate.hxx
+++ b/framework/inc/helper/titlebarupdate.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_HELPER_TITLEBARUPDATE_HXX
#define INCLUDED_FRAMEWORK_INC_HELPER_TITLEBARUPDATE_HXX
-#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <general.h>
@@ -43,10 +42,7 @@ namespace framework{
@devstatus draft
@threadsafe yes
*//*-*************************************************************************************************************/
-class TitleBarUpdate : // baseclasses (order necessary for right initialization!)
- private ThreadHelpBase
- // interfaces
- , public ::cppu::WeakImplHelper3<
+class TitleBarUpdate : public ::cppu::WeakImplHelper3<
css::lang::XInitialization
, css::frame::XTitleChangeListener // => XEventListener
, css::frame::XFrameActionListener > // => XEventListener
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index 1805872aa5cd..9450fd23cc98 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -20,7 +20,6 @@
#include <helper/titlebarupdate.hxx>
#include <pattern/window.hxx>
-#include <threadhelp/guard.hxx>
#include <macros/generic.hxx>
#include <services.h>
#include <properties.h>
@@ -54,8 +53,7 @@ static const ::sal_Int32 DEFAULT_ICON_ID = 0;
TitleBarUpdate::TitleBarUpdate(const css::uno::Reference< css::uno::XComponentContext >& xContext)
- : ThreadHelpBase (&Application::GetSolarMutex())
- , m_xContext (xContext )
+ : m_xContext (xContext )
, m_xFrame ( )
{
}
@@ -85,12 +83,11 @@ void SAL_CALL TitleBarUpdate::initialize(const css::uno::Sequence< css::uno::Any
static_cast< ::cppu::OWeakObject* >(this),
1);
- // SYNCHRONIZED ->
- Guard aWriteLock(m_aLock);
- // hold the frame as weak reference(!) so it can die everytimes :-)
- m_xFrame = xFrame;
- aWriteLock.unlock();
- // <- SYNCHRONIZED
+ {
+ SolarMutexGuard g;
+ // hold the frame as weak reference(!) so it can die everytimes :-)
+ m_xFrame = xFrame;
+ }
// start listening
xFrame->addFrameActionListener(this);
@@ -144,14 +141,8 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
#if !defined(MACOSX)
try
{
- // SYNCHRONIZED ->
- Guard aReadLock(m_aLock);
- css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
- aReadLock.unlock();
- // <- SYNCHRONIZED
-
css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
- css::frame::ModuleManager::create( xContext );
+ css::frame::ModuleManager::create( m_xContext );
OUString sDesktopName;
OUString aModuleId = xModuleManager->identify(xFrame);
@@ -215,16 +206,10 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
if ( ! xFrame.is ())
return sal_False;
- // SYNCHRONIZED ->
- Guard aReadLock(m_aLock);
- css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
- aReadLock.unlock();
- // <- SYNCHRONIZED
-
try
{
css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
- css::frame::ModuleManager::create( xContext );
+ css::frame::ModuleManager::create( m_xContext );
rInfo.sID = xModuleManager->identify(xFrame);
::comphelper::SequenceAsHashMap lProps = xModuleManager->getByName (rInfo.sID);
@@ -246,11 +231,11 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
void TitleBarUpdate::impl_forceUpdate()
{
- // SYNCHRONIZED ->
- Guard aReadLock(m_aLock);
- css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
- aReadLock.unlock();
- // <- SYNCHRONIZED
+ css::uno::Reference< css::frame::XFrame > xFrame;
+ {
+ SolarMutexGuard g;
+ xFrame.set(m_xFrame.get(), css::uno::UNO_QUERY);
+ }
// frame already gone ? We hold it weak only ...
if ( ! xFrame.is())