diff options
author | Noel Grandin <noel@peralex.com> | 2013-06-04 13:34:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-06-05 08:13:22 +0200 |
commit | 8c799984cc5b76c20baccffea818e07c440c2330 (patch) | |
tree | 1c6a595817c85386882808ea1294fa2bc581655a | |
parent | c23be036a6b71324302aa8acd3858ea725c2ada6 (diff) |
fdo#46808, Convert the rest of XMultiServiceFactory in framework module
Change-Id: Ife3caf00ab37a8c344f0ab90e40337b3b5bc1571
26 files changed, 119 insertions, 136 deletions
diff --git a/framework/inc/helper/tagwindowasmodified.hxx b/framework/inc/helper/tagwindowasmodified.hxx index a17e1dc5416d..73dbfafae86a 100644 --- a/framework/inc/helper/tagwindowasmodified.hxx +++ b/framework/inc/helper/tagwindowasmodified.hxx @@ -65,9 +65,6 @@ class TagWindowAsModified : // interfaces private: - /// may we need an uno service manager to create own services - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; - /// reference to the frame, where we listen for new loaded documents for updating our own xModel reference css::uno::WeakReference< css::frame::XFrame > m_xFrame; @@ -84,7 +81,7 @@ class TagWindowAsModified : // interfaces //____________________________ // ctor/dtor - TagWindowAsModified(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + TagWindowAsModified(); virtual ~TagWindowAsModified( ); //____________________________ diff --git a/framework/inc/services/dispatchhelper.hxx b/framework/inc/services/dispatchhelper.hxx index a2a89d194fd5..4c0e47bf7d17 100644 --- a/framework/inc/services/dispatchhelper.hxx +++ b/framework/inc/services/dispatchhelper.hxx @@ -58,7 +58,7 @@ class DispatchHelper : public ThreadHelpBase // must be the /** global uno service manager. Can be used to create own needed services. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /** used to wait for asynchronous listener callbacks. */ ::osl::Condition m_aBlock; @@ -75,8 +75,8 @@ class DispatchHelper : public ThreadHelpBase // must be the //--------------------------------------- // ctor/dtor - DispatchHelper( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ); - virtual ~DispatchHelper( ); + DispatchHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + virtual ~DispatchHelper( ); //--------------------------------------- // XInterface, XTypeProvider, XServiceInfo diff --git a/framework/inc/services/modulemanager.hxx b/framework/inc/services/modulemanager.hxx index 68dc4d8d83c2..2427622ab20d 100644 --- a/framework/inc/services/modulemanager.hxx +++ b/framework/inc/services/modulemanager.hxx @@ -30,6 +30,7 @@ #include <com/sun/star/frame/XModuleManager2.hpp> #include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/container/XContainerQuery.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase3.hxx> namespace com { namespace sun { namespace star { namespace lang { @@ -62,7 +63,7 @@ class ModuleManager: /** the global uno service manager. Must be used to create own needed services. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; //--------------------------------------- /** points to the underlying configuration. @@ -93,7 +94,7 @@ class ModuleManager: css::uno::Reference< css::lang::XMultiServiceFactory > const & manager); - ModuleManager(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + ModuleManager(const css::uno::Reference< css::uno::XComponentContext >& xContext); virtual ~ModuleManager( ); diff --git a/framework/inc/services/pathsettings.hxx b/framework/inc/services/pathsettings.hxx index 0c7e2e272be2..d90721e97831 100644 --- a/framework/inc/services/pathsettings.hxx +++ b/framework/inc/services/pathsettings.hxx @@ -122,7 +122,7 @@ class PathSettings : public css::lang::XTypeProvider , private: /** reference to factory, which has create this instance. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /** list of all path variables and her corresponding values. */ PathSettings::PathHash m_lPaths; @@ -156,7 +156,7 @@ class PathSettings : public css::lang::XTypeProvider , Attention: It's neccessary for right function of this class, that the order of base classes is the right one. Because we transfer information from one base to another during this ctor runs! */ - PathSettings(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + PathSettings(const css::uno::Reference< css::uno::XComponentContext >& xContext); /** free all used resources ... if it was not already done. */ virtual ~PathSettings(); diff --git a/framework/inc/services/substitutepathvars.hxx b/framework/inc/services/substitutepathvars.hxx index e9853e1dad79..7604a879a2a4 100644 --- a/framework/inc/services/substitutepathvars.hxx +++ b/framework/inc/services/substitutepathvars.hxx @@ -223,7 +223,7 @@ class SubstitutePathVariables : private ThreadHelpBase, // Struct for right init friend class SubstitutePathVariables_Impl; public: - SubstitutePathVariables( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + SubstitutePathVariables( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); virtual ~SubstitutePathVariables(); // XInterface, XTypeProvider, XServiceInfo @@ -281,7 +281,7 @@ class SubstitutePathVariables : private ThreadHelpBase, // Struct for right init SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup) ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; }; } diff --git a/framework/inc/services/taskcreatorsrv.hxx b/framework/inc/services/taskcreatorsrv.hxx index 68654e0c89e7..184b12a07a7c 100644 --- a/framework/inc/services/taskcreatorsrv.hxx +++ b/framework/inc/services/taskcreatorsrv.hxx @@ -98,14 +98,14 @@ class TaskCreatorService : public css::lang::XTypeProvider /** @short the global uno service manager. @descr Must be used to create own needed services. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; //___________________________________________ // interface public: - TaskCreatorService(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + TaskCreatorService(const css::uno::Reference< css::uno::XComponentContext >& xContext); virtual ~TaskCreatorService( ); // XInterface, XTypeProvider, XServiceInfo diff --git a/framework/inc/tabwin/tabwindow.hxx b/framework/inc/tabwin/tabwindow.hxx index e2bf729a153b..47846eae0fb0 100644 --- a/framework/inc/tabwin/tabwindow.hxx +++ b/framework/inc/tabwin/tabwindow.hxx @@ -61,7 +61,7 @@ class TabWindow : public ::com::sun::star::lang::XTypeProvider , public ::cppu::OWeakObject { public: - TabWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + TabWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); virtual ~TabWindow(); // XInterface, XTypeProvider, XServiceInfo @@ -166,7 +166,7 @@ class TabWindow : public ::com::sun::star::lang::XTypeProvider , sal_Int32 m_nNextTabID; OUString m_aTitlePropName; OUString m_aPosPropName; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow > m_xTopWindow; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xContainerWindow; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xTabControlWindow; diff --git a/framework/inc/tabwin/tabwinfactory.hxx b/framework/inc/tabwin/tabwinfactory.hxx index fb08f20aafbb..df66e495e065 100644 --- a/framework/inc/tabwin/tabwinfactory.hxx +++ b/framework/inc/tabwin/tabwinfactory.hxx @@ -45,7 +45,7 @@ class TabWinFactory : protected ThreadHelpBase public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo> { public: - TabWinFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + TabWinFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); virtual ~TabWinFactory(); // XInterface, XTypeProvider, XServiceInfo @@ -56,7 +56,7 @@ class TabWinFactory : protected ThreadHelpBase virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit2 > m_xToolkit; }; diff --git a/framework/inc/uiconfiguration/moduleuicfgsupplier.hxx b/framework/inc/uiconfiguration/moduleuicfgsupplier.hxx index 1ca6d2383df2..47d1d910c728 100644 --- a/framework/inc/uiconfiguration/moduleuicfgsupplier.hxx +++ b/framework/inc/uiconfiguration/moduleuicfgsupplier.hxx @@ -64,7 +64,7 @@ namespace framework FWK_DECLARE_XTYPEPROVIDER DECLARE_XSERVICEINFO - ModuleUIConfigurationManagerSupplier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager ); + ModuleUIConfigurationManagerSupplier( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ); virtual ~ModuleUIConfigurationManagerSupplier(); // XComponent @@ -94,7 +94,7 @@ namespace framework com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserCfgRootStorage; com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit; com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleMgr; - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener }; } diff --git a/framework/inc/uifactory/menubarfactory.hxx b/framework/inc/uifactory/menubarfactory.hxx index ea58ce908ce3..c0930ca72db2 100644 --- a/framework/inc/uifactory/menubarfactory.hxx +++ b/framework/inc/uifactory/menubarfactory.hxx @@ -45,7 +45,7 @@ namespace framework ::com::sun::star::ui::XUIElementFactory> { public: - MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); virtual ~MenuBarFactory(); // XInterface, XTypeProvider, XServiceInfo @@ -63,9 +63,9 @@ namespace framework ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext); protected: - MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool ); + MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,bool ); - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleManager; }; } diff --git a/framework/inc/uifactory/statusbarfactory.hxx b/framework/inc/uifactory/statusbarfactory.hxx index 2e0e0cd956a8..382d56bcf9e1 100644 --- a/framework/inc/uifactory/statusbarfactory.hxx +++ b/framework/inc/uifactory/statusbarfactory.hxx @@ -34,7 +34,7 @@ namespace framework class StatusBarFactory : public MenuBarFactory { public: - StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); // XInterface, XTypeProvider, XServiceInfo DECLARE_XSERVICEINFO diff --git a/framework/inc/uifactory/toolboxfactory.hxx b/framework/inc/uifactory/toolboxfactory.hxx index 43384bebec02..db166b228d9a 100644 --- a/framework/inc/uifactory/toolboxfactory.hxx +++ b/framework/inc/uifactory/toolboxfactory.hxx @@ -34,7 +34,7 @@ namespace framework class ToolBoxFactory : public MenuBarFactory { public: - ToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + ToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); // XInterface, XTypeProvider, XServiceInfo DECLARE_XSERVICEINFO diff --git a/framework/inc/uifactory/uicontrollerfactory.hxx b/framework/inc/uifactory/uicontrollerfactory.hxx index df3f70aa8603..fd5dfac5ab1a 100644 --- a/framework/inc/uifactory/uicontrollerfactory.hxx +++ b/framework/inc/uifactory/uicontrollerfactory.hxx @@ -61,16 +61,16 @@ class UIControllerFactory : protected ThreadHelpBase, // Struct for right inita virtual void SAL_CALL deregisterController( const OUString& aCommandURL, const OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException); protected: - UIControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager, const rtl::OUString &rUINode ); + UIControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, const rtl::OUString &rUINode ); sal_Bool m_bConfigRead; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ConfigurationAccess_ControllerFactory* m_pConfigAccess; }; class PopupMenuControllerFactory : public UIControllerFactory { public: - PopupMenuControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + PopupMenuControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); // XInterface, XTypeProvider, XServiceInfo DECLARE_XSERVICEINFO @@ -79,7 +79,7 @@ class PopupMenuControllerFactory : public UIControllerFactory class ToolbarControllerFactory : public UIControllerFactory { public: - ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); // XInterface, XTypeProvider, XServiceInfo DECLARE_XSERVICEINFO @@ -88,7 +88,7 @@ class ToolbarControllerFactory : public UIControllerFactory class StatusbarControllerFactory : public UIControllerFactory { public: - StatusbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); + StatusbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); // XInterface, XTypeProvider, XServiceInfo DECLARE_XSERVICEINFO diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx index 2653e2f1b089..605a815d97f6 100644 --- a/framework/source/helper/tagwindowasmodified.cxx +++ b/framework/source/helper/tagwindowasmodified.cxx @@ -59,9 +59,8 @@ DEFINE_XTYPEPROVIDER_4(TagWindowAsModified , css::lang::XEventListener ) //***************************************************************************************************************** -TagWindowAsModified::TagWindowAsModified(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) +TagWindowAsModified::TagWindowAsModified() : ThreadHelpBase (&Application::GetSolarMutex()) - , m_xSMGR (xSMGR ) { } 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); diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx index 725fda901b59..c950e15901ea 100644 --- a/framework/source/tabwin/tabwindow.cxx +++ b/framework/source/tabwin/tabwindow.cxx @@ -85,7 +85,7 @@ PRIVATE_DEFINE_XSERVICEINFO_BASE ( TabWindow DEFINE_INIT_SERVICE ( TabWindow, {} ) -TabWindow::TabWindow( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) : +TabWindow::TabWindow( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : ThreadHelpBase( &Application::GetSolarMutex() ) , ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() ) , ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) ) @@ -94,7 +94,7 @@ TabWindow::TabWindow( const css::uno::Reference< css::lang::XMultiServiceFactory , m_nNextTabID( 1 ) , m_aTitlePropName( "Title" ) , m_aPosPropName( "Position" ) - , m_xServiceManager( xServiceManager ) + , m_xContext( xContext ) , m_aListenerContainer( m_aLock.getShareableOslMutex() ) { } @@ -282,7 +282,7 @@ throw (css::uno::Exception, css::uno::RuntimeException) /* SAFE AREA ----------------------------------------------------------------------------------------------- */ ResetableGuard aLock( m_aLock ); sal_Bool bInitalized( m_bInitialized ); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xServiceManager ); + css::uno::Reference< css::uno::XComponentContext > xContext( m_xContext ); aLock.unlock(); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ @@ -293,11 +293,11 @@ throw (css::uno::Exception, css::uno::RuntimeException) css::uno::Reference< css::awt::XToolkit2 > xToolkit; css::awt::WindowDescriptor aDescriptor; - if ( xSMGR.is() ) + if ( xContext.is() ) { try { - xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) ); + xToolkit = css::awt::Toolkit::create( xContext ); } catch ( const css::uno::RuntimeException& ) { diff --git a/framework/source/tabwin/tabwinfactory.cxx b/framework/source/tabwin/tabwinfactory.cxx index 4f9d4c017300..718447bbf2eb 100644 --- a/framework/source/tabwin/tabwinfactory.cxx +++ b/framework/source/tabwin/tabwinfactory.cxx @@ -46,7 +46,7 @@ namespace framework //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( TabWinFactory , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( TabWinFactory , ::cppu::OWeakObject , SERVICENAME_TABWINFACTORY , IMPLEMENTATIONNAME_TABWINFACTORY @@ -54,9 +54,9 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( TabWinFactory DEFINE_INIT_SERVICE ( TabWinFactory, {} ) -TabWinFactory::TabWinFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) : +TabWinFactory::TabWinFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) : ThreadHelpBase( &Application::GetSolarMutex() ) - , m_xServiceManager( xServiceManager ) + , m_xContext( xContext ) { } @@ -65,12 +65,12 @@ TabWinFactory::~TabWinFactory() } css::uno::Reference< css::uno::XInterface > SAL_CALL TabWinFactory::createInstanceWithContext( - const css::uno::Reference< css::uno::XComponentContext >& Context ) + const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw ( css::uno::Exception, css::uno::RuntimeException ) { css::uno::Sequence< css::uno::Any > aArgs; - return createInstanceWithArgumentsAndContext( aArgs, Context ); + return createInstanceWithArgumentsAndContext( aArgs, xContext ); } css::uno::Reference< css::uno::XInterface > SAL_CALL TabWinFactory::createInstanceWithArgumentsAndContext( @@ -82,7 +82,7 @@ throw ( css::uno::Exception, css::uno::RuntimeException ) /* SAFE AREA ----------------------------------------------------------------------------------------------- */ ResetableGuard aLock( m_aLock ); css::uno::Reference< css::awt::XToolkit2 > xToolkit = m_xToolkit; - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xServiceManager ); + css::uno::Reference< css::uno::XComponentContext > xContext( m_xContext ); aLock.unlock(); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ @@ -99,9 +99,9 @@ throw ( css::uno::Exception, css::uno::RuntimeException ) } } - if ( !xToolkit.is() && xSMGR.is() ) + if ( !xToolkit.is() && xContext.is() ) { - xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(xSMGR) ); + xToolkit = css::awt::Toolkit::create( xContext ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ aLock.lock(); m_xToolkit = xToolkit; @@ -130,7 +130,7 @@ throw ( css::uno::Exception, css::uno::RuntimeException ) if ( xTopWindow.is() ) { - TabWindow* pTabWindow = new TabWindow( xSMGR ); + TabWindow* pTabWindow = new TabWindow( xContext ); css::uno::Sequence< css::uno::Any > aArgs( 1 ); diff --git a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx index c268cfb0213b..c891fd38d1b8 100644 --- a/framework/source/uiconfiguration/moduleuicfgsupplier.cxx +++ b/framework/source/uiconfiguration/moduleuicfgsupplier.cxx @@ -87,7 +87,7 @@ DEFINE_XTYPEPROVIDER_4 ( ModuleUIConfigurationManagerSupplier ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier ) -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ModuleUIConfigurationManagerSupplier , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( ModuleUIConfigurationManagerSupplier , ::cppu::OWeakObject , DECLARE_ASCII("com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ), IMPLEMENTATIONNAME_MODULEUICONFIGURATIONMANAGERSUPPLIER @@ -97,12 +97,12 @@ DEFINE_INIT_SERVICE ( ModuleUIConfigurationManagerSupplier -ModuleUIConfigurationManagerSupplier::ModuleUIConfigurationManagerSupplier( const Reference< XMultiServiceFactory >& xServiceManager ) : +ModuleUIConfigurationManagerSupplier::ModuleUIConfigurationManagerSupplier( const Reference< XComponentContext >& xContext ) : ThreadHelpBase( &Application::GetSolarMutex() ) , m_bDisposed( false ) //TODO_AS , m_bInit( false ) - , m_xModuleMgr( ModuleManager::create( comphelper::getComponentContext(xServiceManager) ) ) - , m_xServiceManager( xServiceManager ) + , m_xModuleMgr( ModuleManager::create( xContext ) ) + , m_xContext( xContext ) , m_aListenerContainer( m_aLock.getShareableOslMutex() ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "ModuleUIConfigurationManagerSupplier::ModuleUIConfigurationManagerSupplier" ); @@ -224,7 +224,7 @@ throw ( NoSuchElementException, RuntimeException) aArg.Value <<= ModuleIdentifier; aArgs[1] <<= aArg; - pIter->second.set( m_xServiceManager->createInstanceWithArguments(SERVICENAME_MODULEUICONFIGURATIONMANAGER, aArgs ),UNO_QUERY ); + pIter->second.set( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(SERVICENAME_MODULEUICONFIGURATIONMANAGER, aArgs, m_xContext ),UNO_QUERY ); } return pIter->second; diff --git a/framework/source/uifactory/menubarfactory.cxx b/framework/source/uifactory/menubarfactory.cxx index 9a3d4e4c3ba6..ca7db534313c 100644 --- a/framework/source/uifactory/menubarfactory.cxx +++ b/framework/source/uifactory/menubarfactory.cxx @@ -54,7 +54,7 @@ namespace framework //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( MenuBarFactory , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( MenuBarFactory , ::cppu::OWeakObject , SERVICENAME_MENUBARFACTORY , IMPLEMENTATIONNAME_MENUBARFACTORY @@ -62,16 +62,16 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( MenuBarFactory DEFINE_INIT_SERVICE ( MenuBarFactory, {} ) -MenuBarFactory::MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) : +MenuBarFactory::MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) : ThreadHelpBase() - , m_xServiceManager( xServiceManager ) - , m_xModuleManager( ModuleManager::create( comphelper::getComponentContext(xServiceManager) ) ) + , m_xContext( xContext ) + , m_xModuleManager( ModuleManager::create( xContext ) ) { } -MenuBarFactory::MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager,bool ) : +MenuBarFactory::MenuBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,bool ) : ThreadHelpBase(&Application::GetSolarMutex()) - , m_xServiceManager( xServiceManager ) - , m_xModuleManager( ModuleManager::create( comphelper::getComponentContext(xServiceManager) ) ) + , m_xContext( xContext ) + , m_xModuleManager( ModuleManager::create( xContext ) ) { } @@ -87,11 +87,11 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l { // SAFE ResetableGuard aLock( m_aLock ); - MenuBarWrapper* pMenuBarWrapper = new MenuBarWrapper( comphelper::getComponentContext(m_xServiceManager) ); + MenuBarWrapper* pMenuBarWrapper = new MenuBarWrapper( m_xContext ); Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pMenuBarWrapper, UNO_QUERY ); Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager = m_xModuleManager; aLock.unlock(); - CreateUIElement(ResourceURL,Args,"MenuOnly","private:resource/menubar/",xMenuBar,xModuleManager, comphelper::getComponentContext(m_xServiceManager)); + CreateUIElement(ResourceURL, Args, "MenuOnly", "private:resource/menubar/", xMenuBar, xModuleManager, m_xContext); return xMenuBar; } void MenuBarFactory::CreateUIElement(const OUString& ResourceURL diff --git a/framework/source/uifactory/statusbarfactory.cxx b/framework/source/uifactory/statusbarfactory.cxx index 76c6443bc188..fbc1b54403d0 100644 --- a/framework/source/uifactory/statusbarfactory.cxx +++ b/framework/source/uifactory/statusbarfactory.cxx @@ -51,7 +51,7 @@ namespace framework //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusBarFactory , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( StatusBarFactory , ::cppu::OWeakObject , SERVICENAME_STATUSBARFACTORY , IMPLEMENTATIONNAME_STATUSBARFACTORY @@ -59,8 +59,8 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusBarFactory DEFINE_INIT_SERVICE ( StatusBarFactory, {} ) -StatusBarFactory::StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) : - MenuBarFactory( xServiceManager,true ) +StatusBarFactory::StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) : + MenuBarFactory( xContext,true ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::StatusBarFactory" ); } @@ -74,11 +74,11 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::createUIElement" ); // SAFE ResetableGuard aLock( m_aLock ); - StatusBarWrapper* pWrapper = new StatusBarWrapper( comphelper::getComponentContext(m_xServiceManager) ); + StatusBarWrapper* pWrapper = new StatusBarWrapper( m_xContext ); Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY ); Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager = m_xModuleManager; aLock.unlock(); - MenuBarFactory::CreateUIElement(ResourceURL,Args,NULL,"private:resource/statusbar/",xMenuBar,xModuleManager, comphelper::getComponentContext(m_xServiceManager)); + MenuBarFactory::CreateUIElement(ResourceURL, Args, NULL, "private:resource/statusbar/", xMenuBar, xModuleManager, m_xContext ); return xMenuBar; } diff --git a/framework/source/uifactory/toolboxfactory.cxx b/framework/source/uifactory/toolboxfactory.cxx index c5a172bd8c19..fe0104c28e3b 100644 --- a/framework/source/uifactory/toolboxfactory.cxx +++ b/framework/source/uifactory/toolboxfactory.cxx @@ -50,7 +50,7 @@ namespace framework //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ToolBoxFactory , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( ToolBoxFactory , ::cppu::OWeakObject , SERVICENAME_TOOLBARFACTORY , IMPLEMENTATIONNAME_TOOLBARFACTORY @@ -58,8 +58,8 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ToolBoxFactory DEFINE_INIT_SERVICE ( ToolBoxFactory, {} ) -ToolBoxFactory::ToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) : - MenuBarFactory( xServiceManager,true ) +ToolBoxFactory::ToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) : + MenuBarFactory( xContext,true ) { } @@ -70,11 +70,11 @@ Reference< XUIElement > SAL_CALL ToolBoxFactory::createUIElement( throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ) { ResetableGuard aLock( m_aLock ); - ToolBarWrapper* pWrapper = new ToolBarWrapper( comphelper::getComponentContext(m_xServiceManager) ); + ToolBarWrapper* pWrapper = new ToolBarWrapper( m_xContext ); Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY ); Reference< ::com::sun::star::frame::XModuleManager2 > xModuleManager = m_xModuleManager; aLock.unlock(); - CreateUIElement(ResourceURL,Args,"PopupMode","private:resource/toolbar/",xMenuBar,xModuleManager,comphelper::getComponentContext(m_xServiceManager)); + CreateUIElement(ResourceURL, Args, "PopupMode", "private:resource/toolbar/", xMenuBar, xModuleManager, m_xContext); return xMenuBar; } diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index e72a3a8bd80c..b5b48e7af31f 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -41,11 +41,11 @@ namespace framework { UIControllerFactory::UIControllerFactory( - const Reference< XMultiServiceFactory >& xServiceManager, + const Reference< XComponentContext >& xContext, const rtl::OUString &rConfigurationNode ) : ThreadHelpBase() , m_bConfigRead( sal_False ) - , m_xServiceManager( xServiceManager ) + , m_xContext( xContext ) , m_pConfigAccess() { rtl::OUStringBuffer aBuffer; @@ -53,8 +53,7 @@ UIControllerFactory::UIControllerFactory( RTL_CONSTASCII_STRINGPARAM( "/org.openoffice.Office.UI.Controller/Registered/" ) ); aBuffer.append( rConfigurationNode ); - m_pConfigAccess = new ConfigurationAccess_ControllerFactory( - comphelper::getComponentContext(m_xServiceManager), aBuffer.makeStringAndClear() ); + m_pConfigAccess = new ConfigurationAccess_ControllerFactory( m_xContext, aBuffer.makeStringAndClear() ); m_pConfigAccess->acquire(); } @@ -83,7 +82,7 @@ throw (Exception, RuntimeException) OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( aServiceSpecifier, OUString() ); if ( !aServiceName.isEmpty() ) - return m_xServiceManager->createInstance( aServiceName ); + return m_xContext->getServiceManager()->createInstanceWithContext( aServiceName, m_xContext ); else return Reference< XInterface >(); // SAFE @@ -146,13 +145,13 @@ throw (Exception, RuntimeException) } OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( ServiceSpecifier, aPropName ); - Reference< XMultiServiceFactory > xServiceManager( m_xServiceManager ); + Reference< XComponentContext > xContext( m_xContext ); aLock.unlock(); // SAFE if ( !aServiceName.isEmpty() ) - return xServiceManager->createInstanceWithArguments( aServiceName, aNewArgs ); + return xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aServiceName, aNewArgs, xContext ); else return Reference< XInterface >(); } @@ -219,7 +218,7 @@ throw (RuntimeException) } -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( PopupMenuControllerFactory , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( PopupMenuControllerFactory , ::cppu::OWeakObject , SERVICENAME_POPUPMENUCONTROLLERFACTORY , IMPLEMENTATIONNAME_POPUPMENUCONTROLLERFACTORY @@ -227,14 +226,14 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( PopupMenuControllerFactory DEFINE_INIT_SERVICE ( PopupMenuControllerFactory, {} ) -PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) : +PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XComponentContext >& xContext ) : UIControllerFactory( - xServiceManager, + xContext, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PopupMenu" )) ) { } -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ToolbarControllerFactory , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( ToolbarControllerFactory , ::cppu::OWeakObject , SERVICENAME_TOOLBARCONTROLLERFACTORY , IMPLEMENTATIONNAME_TOOLBARCONTROLLERFACTORY @@ -242,14 +241,14 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( ToolbarControllerFactory DEFINE_INIT_SERVICE ( ToolbarControllerFactory, {} ) -ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) : +ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XComponentContext >& xContext ) : UIControllerFactory( - xServiceManager, + xContext, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ToolBar" ))) { } -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusbarControllerFactory , +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( StatusbarControllerFactory , ::cppu::OWeakObject , SERVICENAME_STATUSBARCONTROLLERFACTORY , IMPLEMENTATIONNAME_STATUSBARCONTROLLERFACTORY @@ -257,9 +256,9 @@ DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusbarControllerFactory DEFINE_INIT_SERVICE ( StatusbarControllerFactory, {} ) -StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XMultiServiceFactory >& xServiceManager ) : +StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XComponentContext >& xContext ) : UIControllerFactory( - xServiceManager, + xContext, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StatusBar" )) ) { } |