summaryrefslogtreecommitdiff
path: root/framework/source/services
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/services')
-rw-r--r--framework/source/services/dispatchhelper.cxx8
-rw-r--r--framework/source/services/modulemanager.cxx14
-rw-r--r--framework/source/services/pathsettings.cxx17
-rw-r--r--framework/source/services/substitutepathvars.cxx10
-rw-r--r--framework/source/services/taskcreatorsrv.cxx36
5 files changed, 36 insertions, 49 deletions
diff --git a/framework/source/services/dispatchhelper.cxx b/framework/source/services/dispatchhelper.cxx
index 40adc0695f5e..7da823d00493 100644
--- a/framework/source/services/dispatchhelper.cxx
+++ b/framework/source/services/dispatchhelper.cxx
@@ -33,7 +33,7 @@ namespace framework{
//_______________________________________________
// XInterface, XTypeProvider, XServiceInfo
-DEFINE_XSERVICEINFO_MULTISERVICE(DispatchHelper ,
+DEFINE_XSERVICEINFO_MULTISERVICE_2(DispatchHelper ,
::cppu::OWeakObject ,
"com.sun.star.frame.DispatchHelper",
IMPLEMENTATIONNAME_DISPATCHHELPER)
@@ -46,10 +46,10 @@ DEFINE_INIT_SERVICE( DispatchHelper, {} )
@param xSMGR the global uno service manager, which can be used to create own needed services.
*/
-DispatchHelper::DispatchHelper( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
+DispatchHelper::DispatchHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext )
: ThreadHelpBase( )
// Init member
- , m_xSMGR (xSMGR)
+ , m_xContext (xContext)
{
}
@@ -104,7 +104,7 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch(
// parse given URL
/* SAFE { */
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::util::XURLTransformer > xParser(css::util::URLTransformer::create(::comphelper::getComponentContext(m_xSMGR)) );
+ css::uno::Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(m_xContext);
aReadLock.unlock();
/* } SAFE */
diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx
index 6c18d13627c6..f6990ca4867a 100644
--- a/framework/source/services/modulemanager.cxx
+++ b/framework/source/services/modulemanager.cxx
@@ -65,12 +65,12 @@ ModuleManager::impl_getSupportedServiceNames() {
css::uno::Reference< css::uno::XInterface > ModuleManager::impl_createInstance(
css::uno::Reference< css::lang::XMultiServiceFactory > const & manager)
{
- return static_cast< cppu::OWeakObject * >(new ModuleManager(manager));
+ return static_cast< cppu::OWeakObject * >(new ModuleManager( comphelper::getComponentContext(manager) ));
}
-ModuleManager::ModuleManager(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+ModuleManager::ModuleManager(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: ThreadHelpBase( )
- , m_xSMGR (xSMGR)
+ , m_xContext (xContext)
{
}
@@ -175,7 +175,7 @@ void SAL_CALL ModuleManager::replaceByName(const OUString& sName ,
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE ----------------------------------
@@ -185,7 +185,7 @@ void SAL_CALL ModuleManager::replaceByName(const OUString& sName ,
// flush changes (because an error occurred) we will read them later. If we use a different config access
// we can close it without a flush ... and our read data wont be affected .-)
css::uno::Reference< css::uno::XInterface > xCfg = ::comphelper::ConfigurationHelper::openConfig(
- comphelper::getComponentContext(xSMGR),
+ xContext,
OUString(CFGPATH_FACTORIES),
::comphelper::ConfigurationHelper::E_STANDARD);
css::uno::Reference< css::container::XNameAccess > xModules (xCfg, css::uno::UNO_QUERY_THROW);
@@ -316,7 +316,7 @@ css::uno::Reference< css::container::XNameAccess > ModuleManager::implts_getConf
ReadGuard aReadLock(m_aLock);
if (m_xCFG.is())
return m_xCFG;
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE ----------------------------------
@@ -324,7 +324,7 @@ css::uno::Reference< css::container::XNameAccess > ModuleManager::implts_getConf
try
{
xCfg = ::comphelper::ConfigurationHelper::openConfig(
- comphelper::getComponentContext(xSMGR),
+ xContext,
OUString(CFGPATH_FACTORIES),
::comphelper::ConfigurationHelper::E_READONLY);
}
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index bcdafce0ea23..45d028709548 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -105,7 +105,7 @@ DEFINE_XTYPEPROVIDER_8 ( PathSettings
css::beans::XMultiPropertySet
)
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( PathSettings ,
+DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( PathSettings ,
::cppu::OWeakObject ,
SERVICENAME_PATHSETTINGS ,
IMPLEMENTATIONNAME_PATHSETTINGS
@@ -125,7 +125,7 @@ DEFINE_INIT_SERVICE ( PathSettings,
)
//-----------------------------------------------------------------------------
-PathSettings::PathSettings( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR )
+PathSettings::PathSettings( const css::uno::Reference< css::uno::XComponentContext >& xContext )
// Init baseclasses first
// Attention: Don't change order of initialization!
// ThreadHelpBase is a struct with a lock as member. We can't use a lock as direct member!
@@ -135,7 +135,7 @@ PathSettings::PathSettings( const css::uno::Reference< css::lang::XMultiServiceF
, ::cppu::OPropertySetHelper(*(static_cast< ::cppu::OBroadcastHelper* >(this)))
, ::cppu::OWeakObject()
// Init member
- , m_xSMGR (xSMGR)
+ , m_xContext (xContext)
, m_pPropHelp(0 )
, m_bIgnoreEvents(sal_False)
{
@@ -1083,7 +1083,7 @@ css::uno::Reference< css::util::XStringSubstitution > PathSettings::fa_getSubsti
{
// SAFE ->
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::util::XStringSubstitution > xSubst = m_xSubstitution;
aReadLock.unlock();
// <- SAFE
@@ -1094,7 +1094,6 @@ css::uno::Reference< css::util::XStringSubstitution > PathSettings::fa_getSubsti
// We must replace all used variables inside readed path values.
// In case we can't do so ... the whole office can't work really.
// That's why it seams to be OK to throw a RuntimeException then.
- css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getComponentContext(xSMGR) );
xSubst = css::util::PathSubstitution::create(xContext);
// SAFE ->
@@ -1113,7 +1112,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgOld()
// SAFE ->
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::container::XNameAccess > xCfg = m_xCfgOld;
aReadLock.unlock();
// <- SAFE
@@ -1122,7 +1121,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgOld()
{
xCfg = css::uno::Reference< css::container::XNameAccess >(
::comphelper::ConfigurationHelper::openConfig(
- comphelper::getComponentContext(xSMGR),
+ xContext,
CFG_NODE_OLD,
::comphelper::ConfigurationHelper::E_STANDARD), // not readonly! Sometimes we need write access there !!!
css::uno::UNO_QUERY_THROW);
@@ -1143,7 +1142,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew()
// SAFE ->
ReadGuard aReadLock(m_aLock);
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::container::XNameAccess > xCfg = m_xCfgNew;
if (xCfg.is())
return xCfg;
@@ -1154,7 +1153,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew()
{
xCfg = css::uno::Reference< css::container::XNameAccess >(
::comphelper::ConfigurationHelper::openConfig(
- comphelper::getComponentContext(xSMGR),
+ xContext,
CFG_NODE_NEW,
::comphelper::ConfigurationHelper::E_STANDARD),
css::uno::UNO_QUERY_THROW);
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index eef36dd24bd8..d012b6dd4eee 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -554,7 +554,7 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration(
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables ,
+DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( SubstitutePathVariables ,
::cppu::OWeakObject ,
"com.sun.star.util.PathSubstitution",
IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES )
@@ -562,12 +562,12 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables
DEFINE_INIT_SERVICE ( SubstitutePathVariables, {} )
-SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiServiceFactory >& xServiceManager ) :
+SubstitutePathVariables::SubstitutePathVariables( const Reference< XComponentContext >& xContext ) :
ThreadHelpBase(),
m_aVarStart( SIGN_STARTVARIABLE ),
m_aVarEnd( SIGN_ENDVARIABLE ),
m_aImpl( LINK( this, SubstitutePathVariables, implts_ConfigurationNotify )),
- m_xServiceManager( xServiceManager )
+ m_xContext( xContext )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SubstitutePathVariables" );
int i;
@@ -684,7 +684,7 @@ OUString SubstitutePathVariables::GetWorkPath() const
try
{
::comphelper::ConfigurationHelper::readDirectKey(
- comphelper::getComponentContext(m_xServiceManager),
+ m_xContext,
OUString("org.openoffice.Office.Paths"),
OUString("Paths/Work"),
OUString("WritePath"),
@@ -709,7 +709,7 @@ OUString SubstitutePathVariables::GetWorkVariableValue() const
try
{
::comphelper::ConfigurationHelper::readDirectKey(
- comphelper::getComponentContext(m_xServiceManager),
+ m_xContext,
OUString("org.openoffice.Office.Paths"),
OUString("Variables"),
OUString("Work"),
diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index 6b11a3f168a7..7d90b9293791 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -62,7 +62,7 @@ DEFINE_XTYPEPROVIDER_3(TaskCreatorService ,
css::lang::XSingleServiceFactory)
//-----------------------------------------------
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE(TaskCreatorService ,
+DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2(TaskCreatorService ,
::cppu::OWeakObject ,
"com.sun.star.frame.TaskCreator",
IMPLEMENTATIONNAME_FWK_TASKCREATOR)
@@ -80,10 +80,10 @@ DEFINE_INIT_SERVICE(
)
//-----------------------------------------------
-TaskCreatorService::TaskCreatorService(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
+TaskCreatorService::TaskCreatorService(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: ThreadHelpBase (&Application::GetSolarMutex())
, ::cppu::OWeakObject( )
- , m_xSMGR (xSMGR )
+ , m_xContext (xContext )
{
}
@@ -117,12 +117,6 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI
sal_Bool bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE) , sal_False );
sal_Bool bEnableTitleBarUpdate = lArgs.getUnpackedValueOrDefault(OUString(ARGUMENT_ENABLE_TITLEBARUPDATE) , sal_True );
- /* SAFE { */
- ReadGuard aReadLock( m_aLock );
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
- aReadLock.unlock();
- /* } SAFE */
-
// We use FrameName property to set it as API name of the new created frame later.
// But those frame names must be different from the set of special target names as e.g. _blank, _self etcpp !
OUString sRightName = impl_filterNames(sFrameName);
@@ -207,12 +201,12 @@ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContai
{
// SAFE ->
ReadGuard aReadLock( m_aLock );
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE
// get toolkit to create task container window
- css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) );
+ css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( xContext );
// Check if child frames can be created realy. We need at least a valid window at the parent frame ...
css::uno::Reference< css::awt::XWindowPeer > xParentWindowPeer;
@@ -270,12 +264,12 @@ css::uno::Reference< css::frame::XFrame2 > TaskCreatorService::implts_createFram
{
// SAFE ->
ReadGuard aReadLock( m_aLock );
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE
// create new frame.
- css::uno::Reference< css::frame::XFrame2 > xNewFrame = css::frame::Frame::create( comphelper::getComponentContext(xSMGR) );
+ css::uno::Reference< css::frame::XFrame2 > xNewFrame = css::frame::Frame::create( xContext );
// Set window on frame.
// Do it before calling any other interface methods ...
@@ -303,7 +297,7 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re
{
// SAFE ->
ReadGuard aReadLock( m_aLock );
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE
@@ -311,7 +305,7 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re
// We must create a special listener service and couple it with the new created task frame.
// He will restore or save the window state of it ...
// See used classes for further information too.
- PersistentWindowState* pPersistentStateHandler = new PersistentWindowState( comphelper::getComponentContext(xSMGR));
+ PersistentWindowState* pPersistentStateHandler = new PersistentWindowState( xContext );
css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pPersistentStateHandler), css::uno::UNO_QUERY_THROW);
css::uno::Sequence< css::uno::Any > lInitData(1);
@@ -322,16 +316,10 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re
//-----------------------------------------------
void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame )
{
- // SAFE ->
- ReadGuard aReadLock( m_aLock );
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
- aReadLock.unlock();
- // <- SAFE
-
// Special feature: It's allowed for frames using a top level window only!
// We must create a special listener service and couple it with the new created task frame.
// It will tag the window as modified if the underlying model was modified ...
- TagWindowAsModified* pTag = new TagWindowAsModified(xSMGR);
+ TagWindowAsModified* pTag = new TagWindowAsModified();
css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pTag), css::uno::UNO_QUERY_THROW);
css::uno::Sequence< css::uno::Any > lInitData(1);
@@ -344,11 +332,11 @@ void TaskCreatorService::implts_establishTitleBarUpdate( const css::uno::Referen
{
// SAFE ->
ReadGuard aReadLock( m_aLock );
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aReadLock.unlock();
// <- SAFE
- TitleBarUpdate* pHelper = new TitleBarUpdate (comphelper::getComponentContext(xSMGR));
+ TitleBarUpdate* pHelper = new TitleBarUpdate (xContext);
css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW);
css::uno::Sequence< css::uno::Any > lInitData(1);