diff options
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/helper/tagwindowasmodified.cxx | 3 | ||||
-rw-r--r-- | framework/source/services/dispatchhelper.cxx | 8 | ||||
-rw-r--r-- | framework/source/services/modulemanager.cxx | 14 | ||||
-rw-r--r-- | framework/source/services/pathsettings.cxx | 17 | ||||
-rw-r--r-- | framework/source/services/substitutepathvars.cxx | 10 | ||||
-rw-r--r-- | framework/source/services/taskcreatorsrv.cxx | 36 | ||||
-rw-r--r-- | framework/source/tabwin/tabwindow.cxx | 10 | ||||
-rw-r--r-- | framework/source/tabwin/tabwinfactory.cxx | 18 | ||||
-rw-r--r-- | framework/source/uiconfiguration/moduleuicfgsupplier.cxx | 10 | ||||
-rw-r--r-- | framework/source/uifactory/menubarfactory.cxx | 18 | ||||
-rw-r--r-- | framework/source/uifactory/statusbarfactory.cxx | 10 | ||||
-rw-r--r-- | framework/source/uifactory/toolboxfactory.cxx | 10 | ||||
-rw-r--r-- | framework/source/uifactory/uicontrollerfactory.cxx | 31 |
13 files changed, 90 insertions, 105 deletions
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" )) ) { } |