diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-20 11:51:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-20 15:04:14 +0100 |
commit | 614742430223b2ea90b0b099323cc7e8fc352473 (patch) | |
tree | abdd38bb37cc15a4076cb18ad2034dfbad1f64af | |
parent | d8910d12b897e622f4b5f8a47d8a10fe77efbef8 (diff) |
Access safe members directly
Change-Id: Ie76f2219c5bce609a23a0bc70d6da43f527ce12d
-rw-r--r-- | framework/inc/classes/taskcreator.hxx | 3 | ||||
-rw-r--r-- | framework/source/classes/taskcreator.cxx | 19 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 1 |
3 files changed, 7 insertions, 16 deletions
diff --git a/framework/inc/classes/taskcreator.hxx b/framework/inc/classes/taskcreator.hxx index aaef28cb5fd9..f0aac5d46acf 100644 --- a/framework/inc/classes/taskcreator.hxx +++ b/framework/inc/classes/taskcreator.hxx @@ -20,7 +20,6 @@ #ifndef INCLUDED_FRAMEWORK_INC_CLASSES_TASKCREATOR_HXX #define INCLUDED_FRAMEWORK_INC_CLASSES_TASKCREATOR_HXX -#include <threadhelp/threadhelpbase.hxx> #include <macros/generic.hxx> #include <general.h> @@ -41,7 +40,7 @@ namespace framework{ @devstatus ready to use @threadsafe yes *//*-*************************************************************************************************************/ -class TaskCreator : private ThreadHelpBase +class TaskCreator { // member diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index b63c9267947b..b7b850a7d1b5 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -18,7 +18,6 @@ */ #include <classes/taskcreator.hxx> -#include <threadhelp/guard.hxx> #include <loadenv/targethelper.hxx> #include <services.h> #include <taskcreatordefs.hxx> @@ -43,8 +42,7 @@ namespace framework{ points to the valid uno service manager *//*-*****************************************************************************************************/ TaskCreator::TaskCreator( const css::uno::Reference< css::uno::XComponentContext >& xContext ) - : ThreadHelpBase( ) - , m_xContext ( xContext ) + : m_xContext ( xContext ) { } @@ -54,7 +52,6 @@ TaskCreator::TaskCreator( const css::uno::Reference< css::uno::XComponentContext *//*-*****************************************************************************************************/ TaskCreator::~TaskCreator() { - m_xContext.clear(); } /*-**************************************************************************************************** @@ -63,12 +60,6 @@ TaskCreator::~TaskCreator() css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUString& sName , sal_Bool bVisible ) { - /* SAFE { */ - Guard aReadLock( m_aLock ); - css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; - aReadLock.unlock(); - /* } SAFE */ - css::uno::Reference< css::lang::XSingleServiceFactory > xCreator; OUString sCreator = IMPLEMENTATIONNAME_FWK_TASKCREATOR; @@ -80,12 +71,12 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin ) { - boost::optional<OUString> x(officecfg::Office::TabBrowse::TaskCreatorService::ImplementationName::get(xContext)); + boost::optional<OUString> x(officecfg::Office::TabBrowse::TaskCreatorService::ImplementationName::get(m_xContext)); if (x) sCreator = x.get(); } xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >( - xContext->getServiceManager()->createInstanceWithContext(sCreator, xContext), css::uno::UNO_QUERY_THROW); + m_xContext->getServiceManager()->createInstanceWithContext(sCreator, m_xContext), css::uno::UNO_QUERY_THROW); } catch(const css::uno::Exception&) {} @@ -95,13 +86,13 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin // BTW: The used fallback creator service (IMPLEMENTATIONNAME_FWK_TASKCREATOR) is implemented in the same // library then these class here ... Why we should not be able to create it ? if ( ! xCreator.is()) - xCreator = css::frame::TaskCreator::create(xContext); + xCreator = css::frame::TaskCreator::create(m_xContext); css::uno::Sequence< css::uno::Any > lArgs(5); css::beans::NamedValue aArg ; aArg.Name = OUString(ARGUMENT_PARENTFRAME); - aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY_THROW); + aArg.Value <<= css::uno::Reference< css::frame::XFrame >( css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY_THROW); lArgs[0] <<= aArg; aArg.Name = OUString(ARGUMENT_CREATETOPWINDOW); diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 44948d3242ba..028397db5989 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -28,6 +28,7 @@ #include <dispatch/interceptionhelper.hxx> #include <classes/taskcreator.hxx> +#include <threadhelp/lockhelper.hxx> #include <threadhelp/transactionguard.hxx> #include <general.h> #include <properties.h> |