summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-18 09:42:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-18 09:43:18 +0100
commit309951d6d6fcea92a91b8074798158c00bf14040 (patch)
tree67c798c93f31f406119d9b248cae0aea50b234ae
parent093df487b40ec38bb334180a874fcd314d6dad81 (diff)
Access safe data members directly
Change-Id: Ide204709c54fa476b9cc4f6a9446a8fb2730950c
-rw-r--r--framework/inc/dispatch/startmoduledispatcher.hxx6
-rw-r--r--framework/source/dispatch/startmoduledispatcher.cxx24
2 files changed, 7 insertions, 23 deletions
diff --git a/framework/inc/dispatch/startmoduledispatcher.hxx b/framework/inc/dispatch/startmoduledispatcher.hxx
index 681593bf5bbc..3849ec6df304 100644
--- a/framework/inc/dispatch/startmoduledispatcher.hxx
+++ b/framework/inc/dispatch/startmoduledispatcher.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_STARTMODULEDISPATCHER_HXX
#define INCLUDED_FRAMEWORK_INC_DISPATCH_STARTMODULEDISPATCHER_HXX
-#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/generic.hxx>
@@ -48,9 +47,7 @@ namespace framework{
/**
@short helper to handle all URLs related to the StartModule
*/
-class StartModuleDispatcher : // baseclasses ... order is necessary for right initialization!
- private ThreadHelpBase,
- public ::cppu::WeakImplHelper2<
+class StartModuleDispatcher : public ::cppu::WeakImplHelper2<
css::frame::XNotifyingDispatch, // => XDispatch
css::frame::XDispatchInformationProvider >
{
@@ -75,6 +72,7 @@ class StartModuleDispatcher : // baseclasses ... order is necessary for right in
/** @short list of registered status listener */
+ osl::Mutex m_mutex;
ListenerHash m_lStatusListener;
diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx
index ce08b00f8af6..20bcb1a5a0ec 100644
--- a/framework/source/dispatch/startmoduledispatcher.cxx
+++ b/framework/source/dispatch/startmoduledispatcher.cxx
@@ -21,7 +21,6 @@
#include <dispatch/startmoduledispatcher.hxx>
#include <pattern/frame.hxx>
-#include <threadhelp/guard.hxx>
#include <framework/framelistanalyzer.hxx>
#include <dispatchcommands.h>
#include <targets.h>
@@ -56,11 +55,10 @@ namespace fpf = ::framework::pattern::frame;
StartModuleDispatcher::StartModuleDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::uno::Reference< css::frame::XFrame >& xFrame ,
const OUString& sTarget)
- : ThreadHelpBase (&Application::GetSolarMutex() )
- , m_xContext (rxContext )
+ : m_xContext (rxContext )
, m_xOwner (xFrame )
, m_sDispatchTarget (sTarget )
- , m_lStatusListener (m_aLock.getShareableOslMutex())
+ , m_lStatusListener (m_mutex)
{
}
@@ -131,14 +129,8 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere
if ( ! SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE))
return sal_False;
- // SAFE -> ----------------------------------
- Guard aReadLock(m_aLock);
- css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
- aReadLock.unlock();
- // <- SAFE ----------------------------------
-
css::uno::Reference< css::frame::XFramesSupplier > xDesktop(
- css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY);
+ css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY);
FrameListAnalyzer aCheck(
xDesktop,
@@ -162,17 +154,11 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere
::sal_Bool StartModuleDispatcher::implts_establishBackingMode()
{
- // SAFE -> ----------------------------------
- Guard aReadLock(m_aLock);
- css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
- aReadLock.unlock();
- // <- SAFE ----------------------------------
-
- css::uno::Reference< css::frame::XDesktop2> xDesktop = css::frame::Desktop::create( xContext );
+ css::uno::Reference< css::frame::XDesktop2> xDesktop = css::frame::Desktop::create( m_xContext );
css::uno::Reference< css::frame::XFrame > xFrame = xDesktop->findFrame(SPECIALTARGET_BLANK, 0);
css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
- css::uno::Reference< css::frame::XController > xStartModule = css::frame::StartModule::createWithParentWindow(xContext, xContainerWindow);
+ css::uno::Reference< css::frame::XController > xStartModule = css::frame::StartModule::createWithParentWindow(m_xContext, xContainerWindow);
css::uno::Reference< css::awt::XWindow > xComponentWindow(xStartModule, css::uno::UNO_QUERY);
xFrame->setComponent(xComponentWindow, xStartModule);
xStartModule->attachFrame(xFrame);