diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-27 15:38:47 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-28 08:10:25 +0200 |
commit | e0fc16f769efc7b0c0b517a80523bb4e2c87b618 (patch) | |
tree | eb7271dcdf3f46bd3c9205548082a9d2cfd9a05a /framework | |
parent | c380b432e32647ca9583b688c9b2f5688d7c2695 (diff) |
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: I8272ecab34711654ed27625a571cf2553ffd7468
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/helper/statusindicatorfactory.hxx | 4 | ||||
-rw-r--r-- | framework/inc/helper/titlebarupdate.hxx | 6 | ||||
-rw-r--r-- | framework/inc/jobs/shelljob.hxx | 6 | ||||
-rw-r--r-- | framework/inc/recording/dispatchrecorder.hxx | 3 | ||||
-rw-r--r-- | framework/inc/services/autorecovery.hxx | 4 | ||||
-rw-r--r-- | framework/inc/services/backingcomp.hxx | 5 | ||||
-rw-r--r-- | framework/inc/services/layoutmanager.hxx | 4 | ||||
-rw-r--r-- | framework/source/helper/statusindicatorfactory.cxx | 18 | ||||
-rw-r--r-- | framework/source/helper/titlebarupdate.cxx | 13 | ||||
-rw-r--r-- | framework/source/jobs/shelljob.cxx | 15 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 42 | ||||
-rw-r--r-- | framework/source/recording/dispatchrecorder.cxx | 7 | ||||
-rw-r--r-- | framework/source/services/autorecovery.cxx | 76 | ||||
-rw-r--r-- | framework/source/services/backingcomp.cxx | 18 | ||||
-rw-r--r-- | framework/source/services/taskcreatorsrv.cxx | 2 |
15 files changed, 109 insertions, 114 deletions
diff --git a/framework/inc/helper/statusindicatorfactory.hxx b/framework/inc/helper/statusindicatorfactory.hxx index a5cfa5e61d39..b564f91b96fa 100644 --- a/framework/inc/helper/statusindicatorfactory.hxx +++ b/framework/inc/helper/statusindicatorfactory.hxx @@ -170,7 +170,7 @@ class StatusIndicatorFactory : public css::lang::XTypeProvider IndicatorStack m_aStack; /** uno service manager to create own needed uno resources. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /** most active indicator child, which could work with our shared indicator window only. */ css::uno::Reference< css::task::XStatusIndicator > m_xActiveChild; @@ -213,7 +213,7 @@ class StatusIndicatorFactory : public css::lang::XTypeProvider //--------------------------------------- // ctor - StatusIndicatorFactory(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext); //--------------------------------------- // XInterface, XTypeProvider, XServiceInfo diff --git a/framework/inc/helper/titlebarupdate.hxx b/framework/inc/helper/titlebarupdate.hxx index b6ac8255951e..7dfc262c641f 100644 --- a/framework/inc/helper/titlebarupdate.hxx +++ b/framework/inc/helper/titlebarupdate.hxx @@ -30,7 +30,7 @@ #include <general.h> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -88,7 +88,7 @@ class TitleBarUpdate : // interfaces private: /// may we need an uno service manager to create own services - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /// reference to the frame which was created by the office himself css::uno::WeakReference< css::frame::XFrame > m_xFrame; @@ -100,7 +100,7 @@ class TitleBarUpdate : // interfaces //____________________________ // ctor/dtor - TitleBarUpdate(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + TitleBarUpdate(const css::uno::Reference< css::uno::XComponentContext >& xContext); virtual ~TitleBarUpdate( ); //____________________________ diff --git a/framework/inc/jobs/shelljob.hxx b/framework/inc/jobs/shelljob.hxx index ed8d71ff800a..a54fbcbb7231 100644 --- a/framework/inc/jobs/shelljob.hxx +++ b/framework/inc/jobs/shelljob.hxx @@ -58,7 +58,7 @@ class ShellJob : private ThreadHelpBase //....................................... /** @short reference to an uno service manager. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; //------------------------------------------- // native interface @@ -67,11 +67,11 @@ class ShellJob : private ThreadHelpBase //--------------------------------------- /** @short create new instance of this class. - @param xSMGR + @param xContext reference to the uno service manager, which created this instance. Can be used later to create own needed uno resources on demand. */ - ShellJob(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + ShellJob(const css::uno::Reference< css::uno::XComponentContext >& xContext); //--------------------------------------- /** @short does nothing real ... diff --git a/framework/inc/recording/dispatchrecorder.hxx b/framework/inc/recording/dispatchrecorder.hxx index e88893a97a93..bfdfc4b2cc5e 100644 --- a/framework/inc/recording/dispatchrecorder.hxx +++ b/framework/inc/recording/dispatchrecorder.hxx @@ -59,14 +59,13 @@ class DispatchRecorder { // private member private: - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR ; DispatchStatementList m_aStatements; sal_Int32 m_nRecordingID ; css::uno::Reference< css::script::XTypeConverter > m_xConverter; // public interface public: - DispatchRecorder( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ); + DispatchRecorder( const css::uno::Reference< css::uno::XComponentContext >& xSMGR ); ~DispatchRecorder(); // XInterface, XTypeProvider, XServiceInfo diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx index 2d837c05884d..51359c0ca391 100644 --- a/framework/inc/services/autorecovery.hxx +++ b/framework/inc/services/autorecovery.hxx @@ -307,7 +307,7 @@ class AutoRecovery : 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; //--------------------------------------- /** @short points to the underlying recovery configuration. @@ -439,7 +439,7 @@ class AutoRecovery : public css::lang::XTypeProvider public: - AutoRecovery(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + AutoRecovery(const css::uno::Reference< css::uno::XComponentContext >& xContext); virtual ~AutoRecovery( ); // XInterface, XTypeProvider, XServiceInfo diff --git a/framework/inc/services/backingcomp.hxx b/framework/inc/services/backingcomp.hxx index 17517c326b06..734291c7b72e 100644 --- a/framework/inc/services/backingcomp.hxx +++ b/framework/inc/services/backingcomp.hxx @@ -31,6 +31,7 @@ #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XKeyListener.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -74,7 +75,7 @@ class BackingComp : public css::lang::XTypeProvider /** 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; /** reference to the component window. */ css::uno::Reference< css::awt::XWindow > m_xWindow; @@ -90,7 +91,7 @@ class BackingComp : public css::lang::XTypeProvider public: - BackingComp( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR ); + BackingComp( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~BackingComp( ); // XInterface diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 7bf8d4838304..9abb77a14bc6 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -93,7 +93,7 @@ namespace framework public: enum { DOCKINGAREAS_COUNT = 4 }; - LayoutManager( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMGR ); + LayoutManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext ); virtual ~LayoutManager(); /** declaration of XInterface, XTypeProvider, XServiceInfo */ @@ -285,7 +285,7 @@ namespace framework virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException); - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; /** reference to factory, which has created this instance. */ + css::uno::Reference< css::uno::XComponentContext > m_xContext; /** reference to factory, which has created this instance. */ css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer; css::uno::Reference< css::frame::XFrame > m_xFrame; css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr; diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 18ed206297ad..d01955178560 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -69,10 +69,10 @@ DEFINE_XTYPEPROVIDER_5(StatusIndicatorFactory , css::task::XStatusIndicatorFactory, css::util::XUpdatable ) -DEFINE_XSERVICEINFO_MULTISERVICE(StatusIndicatorFactory , - ::cppu::OWeakObject , - OUString("com.sun.star.task.StatusIndicatorFactory"), - OUString("com.sun.star.comp.framework.StatusIndicatorFactory")) +DEFINE_XSERVICEINFO_MULTISERVICE_2(StatusIndicatorFactory , + ::cppu::OWeakObject , + OUString("com.sun.star.task.StatusIndicatorFactory"), + OUString("com.sun.star.comp.framework.StatusIndicatorFactory")) DEFINE_INIT_SERVICE(StatusIndicatorFactory, { @@ -85,10 +85,10 @@ DEFINE_INIT_SERVICE(StatusIndicatorFactory, ) //----------------------------------------------- -StatusIndicatorFactory::StatusIndicatorFactory(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) +StatusIndicatorFactory::StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase ( ) , ::cppu::OWeakObject ( ) - , m_xSMGR (xSMGR ) + , m_xContext (xContext ) , m_pWakeUp (0 ) , m_bAllowReschedule (sal_False) , m_bAllowParentShow (sal_False) @@ -352,7 +352,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() css::uno::Reference< css::frame::XFrame > xFrame (m_xFrame.get() , css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xPluggWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR( m_xSMGR.get(), css::uno::UNO_QUERY); + css::uno::Reference< css::uno::XComponentContext > xContext( m_xContext); aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -430,7 +430,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() { bool bForceFrontAndFocus(false); ::comphelper::ConfigurationHelper::readDirectKey( - comphelper::getComponentContext(xSMGR), + xContext, OUString("org.openoffice.Office.Common/View"), OUString("NewDocumentHandling"), OUString("ForceFocusAndToFront"), @@ -499,7 +499,6 @@ void StatusIndicatorFactory::impl_showProgress() css::uno::Reference< css::frame::XFrame > xFrame (m_xFrame.get() , css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; aReadLock.lock(); // <- SAFE ---------------------------------- @@ -545,7 +544,6 @@ void StatusIndicatorFactory::impl_hideProgress() css::uno::Reference< css::frame::XFrame > xFrame (m_xFrame.get() , css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; aReadLock.lock(); // <- SAFE ---------------------------------- diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index ddf55b7377a9..5899b83d56a6 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -72,9 +72,9 @@ DEFINE_XTYPEPROVIDER_5(TitleBarUpdate , css::lang::XEventListener ) //***************************************************************************************************************** -TitleBarUpdate::TitleBarUpdate(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) +TitleBarUpdate::TitleBarUpdate(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase (&Application::GetSolarMutex()) - , m_xSMGR (xSMGR ) + , m_xContext (xContext ) , m_xFrame ( ) { } @@ -163,12 +163,12 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr { // SYNCHRONIZED -> ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SYNCHRONIZED css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = - css::frame::ModuleManager::create( comphelper::getComponentContext(xSMGR) ); + css::frame::ModuleManager::create( xContext ); OUString aModuleId = xModuleManager->identify(xFrame); OUString sDesktopName; @@ -228,14 +228,14 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr // SYNCHRONIZED -> ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SYNCHRONIZED try { css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = - css::frame::ModuleManager::create( comphelper::getComponentContext(xSMGR) ); + css::frame::ModuleManager::create( xContext ); rInfo.sID = xModuleManager->identify(xFrame); ::comphelper::SequenceAsHashMap lProps = xModuleManager->getByName (rInfo.sID); @@ -259,7 +259,6 @@ void TitleBarUpdate::impl_forceUpdate() { // SYNCHRONIZED -> ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR ; css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SYNCHRONIZED diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx index 52583f864bea..94647185454d 100644 --- a/framework/source/jobs/shelljob.cxx +++ b/framework/source/jobs/shelljob.cxx @@ -63,10 +63,10 @@ static const OUString PROP_CHECKEXITCODE("CheckExitCode"); //----------------------------------------------- -DEFINE_XSERVICEINFO_MULTISERVICE(ShellJob , - ::cppu::OWeakObject , - SERVICENAME_JOB , - IMPLEMENTATIONNAME_SHELLJOB) +DEFINE_XSERVICEINFO_MULTISERVICE_2(ShellJob , + ::cppu::OWeakObject , + SERVICENAME_JOB , + IMPLEMENTATIONNAME_SHELLJOB) DEFINE_INIT_SERVICE(ShellJob, { @@ -79,9 +79,9 @@ DEFINE_INIT_SERVICE(ShellJob, ) //----------------------------------------------- -ShellJob::ShellJob(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) +ShellJob::ShellJob(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase( ) - , m_xSMGR (xSMGR) + , m_xContext (xContext) { } @@ -143,13 +143,12 @@ OUString ShellJob::impl_substituteCommandVariables(const OUString& sCommand) { // SYNCHRONIZED -> ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SYNCHRONIZED try { - css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getComponentContext(xSMGR) ); css::uno::Reference< css::util::XStringSubstitution > xSubst( css::util::PathSubstitution::create(xContext) ); const ::sal_Bool bSubstRequired = sal_True; const OUString sCompleteCommand = xSubst->substituteVariables(sCommand, bSubstRequired); diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 7bc5a1476893..05bab587e8b1 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -109,15 +109,15 @@ namespace framework IMPLEMENT_FORWARD_XTYPEPROVIDER2( LayoutManager, LayoutManager_Base, LayoutManager_PBase ) IMPLEMENT_FORWARD_XINTERFACE2( LayoutManager, LayoutManager_Base, LayoutManager_PBase ) -DEFINE_XSERVICEINFO_MULTISERVICE( LayoutManager, ::cppu::OWeakObject, SERVICENAME_LAYOUTMANAGER, IMPLEMENTATIONNAME_LAYOUTMANAGER) +DEFINE_XSERVICEINFO_MULTISERVICE_2( LayoutManager, ::cppu::OWeakObject, SERVICENAME_LAYOUTMANAGER, IMPLEMENTATIONNAME_LAYOUTMANAGER) DEFINE_INIT_SERVICE( LayoutManager, {} ) -LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager ) : LayoutManager_Base() +LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : LayoutManager_Base() , ThreadHelpBase( &Application::GetSolarMutex()) , ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex()) , LayoutManager_PBase( *(static_cast< ::cppu::OBroadcastHelper* >(this)) ) - , m_xSMGR( xServiceManager ) - , m_xURLTransformer( URLTransformer::create(::comphelper::getComponentContext(xServiceManager)) ) + , m_xContext( xContext ) + , m_xURLTransformer( URLTransformer::create(xContext) ) , m_nLockCount( 0 ) , m_bActive( false ) , m_bInplaceMenuSet( false ) @@ -135,9 +135,9 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM , m_bPreserveContentSize( false ) , m_bMenuBarCloser( false ) , m_pInplaceMenuBar( NULL ) - , m_xModuleManager( ModuleManager::create( comphelper::getComponentContext(xServiceManager) )) - , m_xUIElementFactoryManager( ui::UIElementFactoryManager::create(comphelper::getComponentContext(xServiceManager)) ) - , m_xPersistentWindowStateSupplier( ui::WindowStateConfiguration::create( comphelper::getComponentContext(xServiceManager) ) ) + , m_xModuleManager( ModuleManager::create( xContext )) + , m_xUIElementFactoryManager( ui::UIElementFactoryManager::create(xContext) ) + , m_xPersistentWindowStateSupplier( ui::WindowStateConfiguration::create( xContext ) ) , m_pGlobalSettings( 0 ) , m_aListenerContainer( m_aLock.getShareableOslMutex() ) , m_pToolbarManager( 0 ) @@ -148,7 +148,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM m_aStatusBarElement.m_aType = "statusbar"; m_aStatusBarElement.m_aName = STATUS_BAR_ALIAS; - m_pToolbarManager = new ToolbarLayoutManager( comphelper::getComponentContext(xServiceManager), Reference<XUIElementFactory>(m_xUIElementFactoryManager, UNO_QUERY_THROW), this ); + m_pToolbarManager = new ToolbarLayoutManager( xContext, Reference<XUIElementFactory>(m_xUIElementFactoryManager, UNO_QUERY_THROW), this ); m_xToolbarManager = uno::Reference< ui::XUIConfigurationListener >( static_cast< OWeakObject* >( m_pToolbarManager ), uno::UNO_QUERY ); Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) ); @@ -254,7 +254,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) Reference< XUIConfiguration > xModuleCfgMgr( m_xModuleCfgMgr, UNO_QUERY ); Reference< XUIConfiguration > xDocCfgMgr( m_xDocCfgMgr, UNO_QUERY ); Reference< XNameAccess > xPersistentWindowState( m_xPersistentWindowState ); - Reference< XMultiServiceFactory > xServiceManager( m_xSMGR ); + Reference< XComponentContext > xContext( m_xContext ); Reference< XNameAccess > xPersistentWindowStateSupplier( m_xPersistentWindowStateSupplier ); ToolbarLayoutManager* pToolbarManager( m_pToolbarManager ); OUString aModuleIdentifier( m_aModuleIdentifier ); @@ -279,8 +279,8 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) if ( !aModuleIdentifier.isEmpty() && aOldModuleIdentifier != aModuleIdentifier ) { Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier; - if ( xServiceManager.is() ) - xModuleCfgSupplier = ModuleUIConfigurationManagerSupplier::create( comphelper::getComponentContext(xServiceManager) ); + if ( xContext.is() ) + xModuleCfgSupplier = ModuleUIConfigurationManagerSupplier::create( xContext ); if ( xModuleCfgMgr.is() ) { @@ -485,7 +485,7 @@ uno::Reference< ui::XUIElement > LayoutManager::implts_findElement( const OUStri sal_Bool LayoutManager::implts_readWindowStateData( const OUString& aName, UIElement& rElementData ) { return readWindowStateData( aName, rElementData, m_aLock, m_xPersistentWindowState, - m_pGlobalSettings, m_bGlobalSettings, comphelper::getComponentContext(m_xSMGR) ); + m_pGlobalSettings, m_bGlobalSettings, m_xContext ); } sal_Bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElementData, @@ -1171,7 +1171,7 @@ throw (uno::RuntimeException) Reference< XDispatchProvider > xDispatchProvider; MenuBar* pMenuBar = new MenuBar; - m_pInplaceMenuBar = new MenuBarManager( comphelper::getComponentContext(m_xSMGR), m_xFrame, m_xURLTransformer, xDispatchProvider, aModuleIdentifier, pMenuBar, sal_True, sal_True ); + m_pInplaceMenuBar = new MenuBarManager( m_xContext, m_xFrame, m_xURLTransformer, xDispatchProvider, aModuleIdentifier, pMenuBar, sal_True, sal_True ); m_pInplaceMenuBar->SetItemContainer( xMergedMenuBar ); SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow ); @@ -1619,10 +1619,10 @@ throw (RuntimeException) else if ( aElementType.equalsIgnoreAsciiCase("dockingwindow")) { uno::Reference< frame::XFrame > xFrame( m_xFrame ); - uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR ); + uno::Reference< XComponentContext > xContext( m_xContext ); aWriteLock.unlock(); - impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, false ); + impl_setDockingWindowVisibility( xContext, xFrame, aElementName, false ); bMustBeLayouted = false; bNotify = false; } @@ -1836,10 +1836,10 @@ throw (RuntimeException) { ReadGuard aReadGuard( m_aLock ); uno::Reference< frame::XFrame > xFrame( m_xFrame ); - uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR ); + uno::Reference< XComponentContext > xContext( m_xContext ); aReadGuard.unlock(); - impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, true ); + impl_setDockingWindowVisibility( xContext, xFrame, aElementName, true ); } else if ( aElementType.equalsIgnoreAsciiCase("toolpanel")) { @@ -1928,10 +1928,10 @@ throw (RuntimeException) { ReadGuard aReadGuard( m_aLock ); uno::Reference< frame::XFrame > xFrame( m_xFrame ); - uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR ); + uno::Reference< XComponentContext > xContext( m_xContext ); aReadGuard.unlock(); - impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, false ); + impl_setDockingWindowVisibility( xContext, xFrame, aElementName, false ); } if ( bMustLayout ) @@ -2623,13 +2623,13 @@ IMPL_LINK_NOARG(LayoutManager, MenuBarClose) { ReadGuard aReadLock( m_aLock ); uno::Reference< frame::XDispatchProvider > xProvider(m_xFrame, uno::UNO_QUERY); - uno::Reference< lang::XMultiServiceFactory > xSMGR = m_xSMGR; + uno::Reference< XComponentContext > xContext( m_xContext ); aReadLock.unlock(); if ( !xProvider.is()) return 0; - uno::Reference< frame::XDispatchHelper > xDispatcher = frame::DispatchHelper::create( comphelper::getComponentContext( xSMGR ) ); + uno::Reference< frame::XDispatchHelper > xDispatcher = frame::DispatchHelper::create( xContext ); xDispatcher->executeDispatch( xProvider, diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx index 02451e107f86..708b4cdd2dbf 100644 --- a/framework/source/recording/dispatchrecorder.cxx +++ b/framework/source/recording/dispatchrecorder.cxx @@ -56,7 +56,7 @@ DEFINE_XTYPEPROVIDER_6( css::container::XIndexAccess, css::container::XElementAccess) -DEFINE_XSERVICEINFO_MULTISERVICE( +DEFINE_XSERVICEINFO_MULTISERVICE_2( DispatchRecorder, ::cppu::OWeakObject, OUString("com.sun.star.frame.DispatchRecorder"), @@ -119,11 +119,10 @@ Sequence< Any > make_seq_out_of_struct( } //*********************************************************************** -DispatchRecorder::DispatchRecorder( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ) +DispatchRecorder::DispatchRecorder( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : ThreadHelpBase ( &Application::GetSolarMutex() ) , ::cppu::OWeakObject( ) - , m_xSMGR ( xSMGR ) - , m_xConverter( css::script::Converter::create(comphelper::getComponentContext(m_xSMGR)) ) + , m_xConverter( css::script::Converter::create(xContext) ) { } diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 9541000f5fe1..9af8eb7d3aa6 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -416,10 +416,10 @@ DEFINE_XTYPEPROVIDER_6(AutoRecovery , css::beans::XPropertySet ) //----------------------------------------------- -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE(AutoRecovery , - ::cppu::OWeakObject , - "com.sun.star.frame.AutoRecovery", - IMPLEMENTATIONNAME_AUTORECOVERY) +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2(AutoRecovery , + ::cppu::OWeakObject , + "com.sun.star.frame.AutoRecovery", + IMPLEMENTATIONNAME_AUTORECOVERY) //----------------------------------------------- DEFINE_INIT_SERVICE( @@ -443,12 +443,12 @@ DEFINE_INIT_SERVICE( ) //----------------------------------------------- -AutoRecovery::AutoRecovery(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) +AutoRecovery::AutoRecovery(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase (&Application::GetSolarMutex() ) , ::cppu::OBroadcastHelper ( m_aLock.getShareableOslMutex() ) , ::cppu::OPropertySetHelper( *(static_cast< ::cppu::OBroadcastHelper* >(this)) ) , ::cppu::OWeakObject ( ) - , m_xSMGR (xSMGR ) + , m_xContext (xContext ) , m_bListenForDocEvents (sal_False ) , m_bListenForConfigChanges (sal_False ) , m_nAutoSaveTimeIntervall (0 ) @@ -930,7 +930,7 @@ css::uno::Reference< css::container::XNameAccess > AutoRecovery::implts_openConf if (m_xRecoveryCFG.is()) return m_xRecoveryCFG; - css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getComponentContext(m_xSMGR); + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -1130,7 +1130,7 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume // 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_xModuleCFG; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -1141,7 +1141,7 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume { // open module config on demand and cache the update access xCFG = css::uno::Reference< css::container::XNameAccess >( - ::comphelper::ConfigurationHelper::openConfig(comphelper::getComponentContext(xSMGR), OUString(CFG_PACKAGE_MODULES), + ::comphelper::ConfigurationHelper::openConfig(xContext, OUString(CFG_PACKAGE_MODULES), ::comphelper::ConfigurationHelper::E_STANDARD), css::uno::UNO_QUERY_THROW); @@ -1158,8 +1158,8 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume xModuleProps->getByName(OUString(CFG_ENTRY_REALDEFAULTFILTER)) >>= rInfo.DefaultFilter; - css::uno::Reference< css::container::XNameAccess > xFilterCFG(xSMGR->createInstance(SERVICENAME_FILTERFACTORY), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::container::XNameAccess > xTypeCFG (xSMGR->createInstance(SERVICENAME_TYPEDETECTION), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::container::XNameAccess > xFilterCFG(xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FILTERFACTORY, xContext), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::container::XNameAccess > xTypeCFG (xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_TYPEDETECTION, xContext), css::uno::UNO_QUERY_THROW); ::comphelper::SequenceAsHashMap lFilterProps (xFilterCFG->getByName(rInfo.DefaultFilter)); OUString sTypeRegistration = lFilterProps.getUnpackedValueOrDefault(OUString(FILTER_PROP_TYPE), OUString()); @@ -1190,11 +1190,11 @@ void AutoRecovery::implts_specifyAppModuleAndFactory(AutoRecovery::TDocumentInfo // 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 ---------------------------------- - css::uno::Reference< css::frame::XModuleManager2 > xManager = ModuleManager::create( comphelper::getComponentContext(xSMGR) ); + css::uno::Reference< css::frame::XModuleManager2 > xManager = ModuleManager::create( xContext ); if (rInfo.AppModule.isEmpty()) rInfo.AppModule = xManager->identify(rInfo.Document); @@ -1373,7 +1373,7 @@ void AutoRecovery::implts_startListening() { // 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::XChangesNotifier > xCFG (m_xRecoveryCFG, css::uno::UNO_QUERY); css::uno::Reference< css::frame::XGlobalEventBroadcaster > xBroadcaster = m_xNewDocBroadcaster; sal_Bool bListenForDocEvents = m_bListenForDocEvents; @@ -1392,7 +1392,7 @@ void AutoRecovery::implts_startListening() if (!xBroadcaster.is()) { - xBroadcaster = css::frame::GlobalEventBroadcaster::create( comphelper::getComponentContext(xSMGR) ); + xBroadcaster = css::frame::GlobalEventBroadcaster::create( xContext ); // SAFE -> ---------------------------------- WriteGuard aWriteLock(m_aLock); m_xNewDocBroadcaster = xBroadcaster; @@ -1717,7 +1717,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame // 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 ---------------------------------- @@ -2004,11 +2004,11 @@ void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible) { // 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 ---------------------------------- - css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create( comphelper::getComponentContext(xSMGR) ), css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XFramesSupplier > xDesktop( css::frame::Desktop::create( xContext ), css::uno::UNO_QUERY); lcl_changeVisibility( xDesktop, bVisible ); aReadLock.unlock(); @@ -2144,7 +2144,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( sal_Bool bAl { // 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 ---------------------------------- @@ -2152,7 +2152,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( sal_Bool bAl if (pParams) xExternalProgress = pParams->m_xProgress; - css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(xSMGR)); + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext); OUString sBackupPath(SvtPathOptions().GetBackupPath()); css::uno::Reference< css::frame::XController > xActiveController; @@ -2557,7 +2557,7 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa else continue; // TODO ERROR! - LoadEnv::initializeUIDefaults( comphelper::getComponentContext(m_xSMGR), lDescriptor, true, NULL ); + LoadEnv::initializeUIDefaults( m_xContext, lDescriptor, true, NULL ); // <- SAFE ------------------------------ aWriteLock.unlock(); @@ -2648,17 +2648,17 @@ void AutoRecovery::implts_openOneDoc(const OUString& sURL , { // 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 ---------------------------------- - css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(xSMGR)); + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext); ::std::vector< Reference< XComponent > > aCleanup; try { // create a new document of the desired type - Reference< XModel2 > xModel( xSMGR->createInstance( rInfo.FactoryService ), UNO_QUERY_THROW ); + Reference< XModel2 > xModel( xContext->getServiceManager()->createInstanceWithContext(rInfo.FactoryService, xContext), UNO_QUERY_THROW ); aCleanup.push_back( xModel.get() ); // put the filter name into the descriptor - we're not going to involve any type detection, so @@ -2773,7 +2773,7 @@ void AutoRecovery::implts_generateNewTempURL(const OUString& sBack { // 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 ---------------------------------- @@ -2788,7 +2788,7 @@ void AutoRecovery::implts_generateNewTempURL(const OUString& sBack OUStringBuffer sUniqueName; if (!rInfo.OrgURL.isEmpty()) { - 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)); css::util::URL aURL; aURL.Complete = rInfo.OrgURL; xParser->parseStrict(aURL); @@ -2980,7 +2980,7 @@ void AutoRecovery::implts_doEmergencySave(const DispatchParams& aParams) // the error report tool is started too in case no recovery // documents exists and was saved. ::comphelper::ConfigurationHelper::writeDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, OUString(CFG_PACKAGE_RECOVERY), OUString(CFG_PATH_RECOVERYINFO), OUString(CFG_ENTRY_CRASHED), @@ -3041,7 +3041,7 @@ void AutoRecovery::implts_doRecovery(const DispatchParams& aParams) // Reset the configuration hint "we was crashed"! ::comphelper::ConfigurationHelper::writeDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, OUString(CFG_PACKAGE_RECOVERY), OUString(CFG_PATH_RECOVERYINFO), OUString(CFG_ENTRY_CRASHED), @@ -3108,7 +3108,7 @@ void AutoRecovery::implts_doSessionQuietQuit(const DispatchParams& /*aParams*/) // Write a hint for "stored session data" into the configuration, so // the on next startup we know what's happen last time ::comphelper::ConfigurationHelper::writeDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, OUString(CFG_PACKAGE_RECOVERY), OUString(CFG_PATH_RECOVERYINFO), OUString(CFG_ENTRY_SESSIONDATA), @@ -3145,7 +3145,7 @@ void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams) // Reset the configuration hint for "session save"! LOG_RECOVERY("... reset config key 'SessionData'") ::comphelper::ConfigurationHelper::writeDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, OUString(CFG_PACKAGE_RECOVERY), OUString(CFG_PATH_RECOVERYINFO), OUString(CFG_ENTRY_SESSIONDATA), @@ -3230,7 +3230,7 @@ AutoRecovery::EFailureSafeResult AutoRecovery::implts_copyFile(const OUString& s try { - aTargetContent = ::ucbhelper::Content(sTargetPath, xEnvironment, comphelper::getComponentContext(m_xSMGR)); + aTargetContent = ::ucbhelper::Content(sTargetPath, xEnvironment, m_xContext); } catch(const css::uno::Exception&) { @@ -3242,7 +3242,7 @@ AutoRecovery::EFailureSafeResult AutoRecovery::implts_copyFile(const OUString& s try { - ::ucbhelper::Content::create(sSource, xEnvironment, comphelper::getComponentContext(m_xSMGR), aSourceContent); + ::ucbhelper::Content::create(sSource, xEnvironment, m_xContext, aSourceContent); aTargetContent.transferContent(aSourceContent, ::ucbhelper::InsertOperation_COPY, sTargetName, nNameClash); } catch(const css::uno::Exception&) @@ -3282,7 +3282,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , { sal_Bool bSessionData = sal_False; ::comphelper::ConfigurationHelper::readDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, OUString(CFG_PACKAGE_RECOVERY), OUString(CFG_PATH_RECOVERYINFO), OUString(CFG_ENTRY_SESSIONDATA), @@ -3301,7 +3301,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , case AUTORECOVERY_PROPHANDLE_CRASHED : aValue = ::comphelper::ConfigurationHelper::readDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, OUString(CFG_PACKAGE_RECOVERY), OUString(CFG_PATH_RECOVERYINFO), OUString(CFG_ENTRY_CRASHED), @@ -3310,7 +3310,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , case AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA : aValue = ::comphelper::ConfigurationHelper::readDirectKey( - comphelper::getComponentContext(m_xSMGR), + m_xContext, OUString(CFG_PACKAGE_RECOVERY), OUString(CFG_PATH_RECOVERYINFO), OUString(CFG_ENTRY_SESSIONDATA), @@ -3374,13 +3374,13 @@ void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList() // SAFE -> ---------------------------------- WriteGuard aWriteLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aWriteLock.unlock(); // <- SAFE ---------------------------------- try { - css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(xSMGR)); + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext); css::uno::Reference< css::container::XIndexAccess > xContainer( xDesktop->getFrames(), @@ -3628,7 +3628,7 @@ void AutoRecovery::st_impl_removeFile(const OUString& sURL) try { - ::ucbhelper::Content aContent = ::ucbhelper::Content(sURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), comphelper::getComponentContext(m_xSMGR)); + ::ucbhelper::Content aContent = ::ucbhelper::Content(sURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), m_xContext); aContent.executeCommand(OUString("delete"), css::uno::makeAny(sal_True)); } catch(const css::uno::Exception&) diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx index b7c1c4ee3f1a..89a757de7192 100644 --- a/framework/source/services/backingcomp.cxx +++ b/framework/source/services/backingcomp.cxx @@ -65,9 +65,9 @@ namespace framework //_______________________________________________ -BackingComp::BackingComp( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR ) +BackingComp::BackingComp( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : ThreadHelpBase (&Application::GetSolarMutex() ) - , m_xSMGR (xSMGR ) + , m_xContext (xContext ) { } @@ -348,7 +348,7 @@ css::uno::Sequence< OUString > BackingComp::impl_getStaticSupportedServiceNames( css::uno::Reference< css::uno::XInterface > SAL_CALL BackingComp::impl_createInstance( /*IN*/ const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ) throw(css::uno::Exception) { - BackingComp* pObject = new BackingComp(xSMGR); + BackingComp* pObject = new BackingComp(comphelper::getComponentContext(xSMGR)); return css::uno::Reference< css::uno::XInterface >(static_cast< ::cppu::OWeakObject* >(pObject), css::uno::UNO_QUERY); } @@ -459,10 +459,10 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f m_xFrame = xFrame; // establish drag&drop mode - ::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener( comphelper::getComponentContext(m_xSMGR), m_xFrame); + ::framework::DropTargetListener* pDropListener = new ::framework::DropTargetListener( m_xContext, m_xFrame); m_xDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >(static_cast< ::cppu::OWeakObject* >(pDropListener), css::uno::UNO_QUERY); - css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) ); + css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( m_xContext ); css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow); if (xDropTarget.is()) { @@ -663,7 +663,7 @@ void SAL_CALL BackingComp::dispose() // kill the menu css::util::URL aURL; aURL.Complete = DECLARE_ASCII(".uno:close"); - 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); if (xParser.is()) xParser->parseStrict(aURL); @@ -678,7 +678,7 @@ void SAL_CALL BackingComp::dispose() // deregister drag&drop helper if (m_xDropTargetListener.is()) { - css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) ); + css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create( m_xContext ); css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget = xToolkit->getDropTarget(m_xWindow); if (xDropTarget.is()) { @@ -703,8 +703,8 @@ void SAL_CALL BackingComp::dispose() } // forget all other used references - m_xFrame = css::uno::Reference< css::frame::XFrame >(); - m_xSMGR = css::uno::Reference< css::lang::XMultiServiceFactory >(); + m_xFrame.clear(); + m_xContext.clear(); aWriteLock.unlock(); /* } SAFE */ diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index a7e0d6c93113..6b11a3f168a7 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -348,7 +348,7 @@ void TaskCreatorService::implts_establishTitleBarUpdate( const css::uno::Referen aReadLock.unlock(); // <- SAFE - TitleBarUpdate* pHelper = new TitleBarUpdate (xSMGR); + TitleBarUpdate* pHelper = new TitleBarUpdate (comphelper::getComponentContext(xSMGR)); 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); |