Kaydet (Commit) e0fc16f7 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert some XMultiServiceFactory to XComponentContext

Change-Id: I8272ecab34711654ed27625a571cf2553ffd7468
üst c380b432
......@@ -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
......
......@@ -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( );
//____________________________
......
......@@ -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 ...
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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 ----------------------------------
......
......@@ -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
......
......@@ -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);
......
......@@ -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,
......
......@@ -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) )
{
}
......
......@@ -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 */
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment