summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-06-04 16:35:09 +0200
committerNoel Grandin <noel@peralex.com>2013-06-05 08:13:23 +0200
commita1afcae81ca3c4b6bb240263b3259090d48c7715 (patch)
tree6045b67820afbf70fad99781b9e2126206bbe66e /ucb
parent546fa9f365ef1b19abe6739d2f42389f82576437 (diff)
fdo#46808, Convert XMultiServiceFactory in ucb module
Change-Id: I4e1cfe22ba6043521dd1237f90ade66f80b29253
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/cacher/cacheddynamicresultset.cxx12
-rw-r--r--ucb/source/cacher/cacheddynamicresultset.hxx6
-rw-r--r--ucb/source/core/identify.cxx4
-rw-r--r--ucb/source/core/identify.hxx4
-rw-r--r--ucb/source/core/ucb.cxx24
-rw-r--r--ucb/source/core/ucb.hxx4
-rw-r--r--ucb/source/core/ucbcmds.cxx26
-rw-r--r--ucb/source/core/ucbstore.cxx34
-rw-r--r--ucb/source/core/ucbstore.hxx12
9 files changed, 57 insertions, 69 deletions
diff --git a/ucb/source/cacher/cacheddynamicresultset.cxx b/ucb/source/cacher/cacheddynamicresultset.cxx
index 8b9f1a9a6959..ab6d880bdb21 100644
--- a/ucb/source/cacher/cacheddynamicresultset.cxx
+++ b/ucb/source/cacher/cacheddynamicresultset.cxx
@@ -33,8 +33,8 @@ using namespace com::sun::star::uno;
CachedDynamicResultSet::CachedDynamicResultSet(
Reference< XDynamicResultSet > xOrigin
, const Reference< XContentIdentifierMapping > & xContentMapping
- , const Reference< XMultiServiceFactory > & xSMgr )
- : DynamicResultSetWrapper( xOrigin, comphelper::getComponentContext(xSMgr) )
+ , const Reference< XComponentContext > & xContext )
+ : DynamicResultSetWrapper( xOrigin, xContext )
, m_xContentIdentifierMapping( xContentMapping )
{
impl_init();
@@ -133,9 +133,9 @@ void SAL_CALL CachedDynamicResultSet
//--------------------------------------------------------------------------
CachedDynamicResultSetFactory::CachedDynamicResultSetFactory(
- const Reference< XMultiServiceFactory > & rSMgr )
+ const Reference< XComponentContext > & xContext )
{
- m_xSMgr = rSMgr;
+ m_xContext = xContext;
}
CachedDynamicResultSetFactory::~CachedDynamicResultSetFactory()
@@ -164,7 +164,7 @@ XTYPEPROVIDER_IMPL_3( CachedDynamicResultSetFactory,
// CachedDynamicResultSetFactory XServiceInfo methods.
//--------------------------------------------------------------------------
-XSERVICEINFO_IMPL_1( CachedDynamicResultSetFactory,
+XSERVICEINFO_IMPL_1_CTX( CachedDynamicResultSetFactory,
OUString( "com.sun.star.comp.ucb.CachedDynamicResultSetFactory" ),
OUString( CACHED_DRS_FACTORY_NAME ) );
@@ -186,7 +186,7 @@ Reference< XDynamicResultSet > SAL_CALL CachedDynamicResultSetFactory
throw( RuntimeException )
{
Reference< XDynamicResultSet > xRet;
- xRet = new CachedDynamicResultSet( SourceStub, ContentIdentifierMapping, m_xSMgr );
+ xRet = new CachedDynamicResultSet( SourceStub, ContentIdentifierMapping, m_xContext );
return xRet;
}
diff --git a/ucb/source/cacher/cacheddynamicresultset.hxx b/ucb/source/cacher/cacheddynamicresultset.hxx
index 18dd49a0d41c..6b7c84fb93cb 100644
--- a/ucb/source/cacher/cacheddynamicresultset.hxx
+++ b/ucb/source/cacher/cacheddynamicresultset.hxx
@@ -51,7 +51,7 @@ public:
, const com::sun::star::uno::Reference<
com::sun::star::ucb::XContentIdentifierMapping > & xContentMapping
, const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > & xSMgr );
+ com::sun::star::uno::XComponentContext > & xContext );
virtual ~CachedDynamicResultSet();
@@ -87,13 +87,13 @@ class CachedDynamicResultSetFactory
{
protected:
com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ com::sun::star::uno::XComponentContext > m_xContext;
public:
CachedDynamicResultSetFactory(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > & rSMgr);
+ com::sun::star::uno::XComponentContext > & xContext);
virtual ~CachedDynamicResultSetFactory();
diff --git a/ucb/source/core/identify.cxx b/ucb/source/core/identify.cxx
index 209aeeda0c44..53d0dff03aaf 100644
--- a/ucb/source/core/identify.cxx
+++ b/ucb/source/core/identify.cxx
@@ -38,10 +38,8 @@ using namespace com::sun::star::ucb;
//=========================================================================
ContentIdentifier::ContentIdentifier(
- const Reference< XMultiServiceFactory >& rxSMgr,
const OUString& ContentId )
-: m_xSMgr( rxSMgr ),
- m_aContentId( ContentId )
+: m_aContentId( ContentId )
{
}
diff --git a/ucb/source/core/identify.hxx b/ucb/source/core/identify.hxx
index 8c504f7a5e75..753257871ce5 100644
--- a/ucb/source/core/identify.hxx
+++ b/ucb/source/core/identify.hxx
@@ -35,8 +35,7 @@ class ContentIdentifier :
public com::sun::star::ucb::XContentIdentifier
{
public:
- ContentIdentifier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
- const OUString& ContentId );
+ ContentIdentifier( const OUString& ContentId );
virtual ~ContentIdentifier();
// XInterface
@@ -52,7 +51,6 @@ public:
throw( com::sun::star::uno::RuntimeException );
private:
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
OUString m_aContentId;
OUString m_aProviderScheme;
};
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index 493ff514f5ec..3d45c7f621c8 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -231,13 +231,13 @@ bool createContentProviderData(
//=========================================================================
UniversalContentBroker::UniversalContentBroker(
- const Reference< com::sun::star::lang::XMultiServiceFactory >& rXSMgr )
-: m_xSMgr( rXSMgr ),
+ const Reference< com::sun::star::uno::XComponentContext >& xContext )
+: m_xContext( xContext ),
m_pDisposeEventListeners( NULL ),
m_nInitCount( 0 ), //@@@ see initialize() method
m_nCommandId( 0 )
{
- OSL_ENSURE( m_xSMgr.is(),
+ OSL_ENSURE( m_xContext.is(),
"UniversalContentBroker ctor: No service manager" );
}
@@ -333,7 +333,7 @@ void SAL_CALL UniversalContentBroker::removeEventListener(
//
//=========================================================================
-XSERVICEINFO_IMPL_1( UniversalContentBroker,
+XSERVICEINFO_IMPL_1_CTX( UniversalContentBroker,
OUString( "com.sun.star.comp.ucb.UniversalContentBroker" ),
OUString( UCB_SERVICE_NAME ) );
@@ -598,7 +598,7 @@ Reference< XContentIdentifier > SAL_CALL
}
if ( !xIdentifier.is() )
- xIdentifier = new ContentIdentifier( m_xSMgr, ContentId );
+ xIdentifier = new ContentIdentifier( ContentId );
return xIdentifier;
}
@@ -846,11 +846,11 @@ void UniversalContentBroker::prepareAndRegister(
&aProviderArguments))
{
registerAtUcb(this,
- m_xSMgr,
- aIt->ServiceName,
- aProviderArguments,
- aIt->URLTemplate,
- 0);
+ m_xContext,
+ aIt->ServiceName,
+ aProviderArguments,
+ aIt->URLTemplate,
+ 0);
}
else
@@ -864,7 +864,7 @@ bool UniversalContentBroker::getContentProviderData(
const OUString & rKey2,
ContentProviderDataList & rListToFill )
{
- if ( !m_xSMgr.is() || rKey1.isEmpty() || rKey2.isEmpty() )
+ if ( !m_xContext.is() || rKey1.isEmpty() || rKey2.isEmpty() )
{
OSL_FAIL( "UniversalContentBroker::getContentProviderData - Invalid argument!" );
return false;
@@ -873,7 +873,7 @@ bool UniversalContentBroker::getContentProviderData(
try
{
uno::Reference< lang::XMultiServiceFactory > xConfigProv =
- configuration::theDefaultProvider::get( comphelper::getComponentContext(m_xSMgr) );
+ configuration::theDefaultProvider::get( m_xContext );
OUStringBuffer aFullPath;
aFullPath.appendAscii( CONFIG_CONTENTPROVIDERS_KEY "/['" );
diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx
index 50d5d699cc16..54e215b4341d 100644
--- a/ucb/source/core/ucb.hxx
+++ b/ucb/source/core/ucb.hxx
@@ -62,7 +62,7 @@ class UniversalContentBroker :
public com::sun::star::util::XChangesListener
{
public:
- UniversalContentBroker( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
+ UniversalContentBroker( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext );
virtual ~UniversalContentBroker();
// XInterface
@@ -198,7 +198,7 @@ private:
void prepareAndRegister( const ucbhelper::ContentProviderDataList& rData);
com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ com::sun::star::uno::XComponentContext > m_xContext;
com::sun::star::uno::Reference<
com::sun::star::util::XChangesNotifier > m_xNotifier;
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index 3c4fdd71fe02..b1f9e26bc04e 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -76,19 +76,19 @@ namespace
struct TransferCommandContext
{
- uno::Reference< lang::XMultiServiceFactory > xSMgr;
+ uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< ucb::XCommandProcessor > xProcessor;
uno::Reference< ucb::XCommandEnvironment > xEnv;
uno::Reference< ucb::XCommandEnvironment > xOrigEnv;
ucb::GlobalTransferCommandArgument2 aArg;
TransferCommandContext(
- const uno::Reference< lang::XMultiServiceFactory > & rxSMgr,
+ const uno::Reference< uno::XComponentContext > & xContext,
const uno::Reference< ucb::XCommandProcessor > & rxProcessor,
const uno::Reference< ucb::XCommandEnvironment > & rxEnv,
const uno::Reference< ucb::XCommandEnvironment > & rxOrigEnv,
const ucb::GlobalTransferCommandArgument2 & rArg )
- : xSMgr( rxSMgr ), xProcessor( rxProcessor ), xEnv( rxEnv ),
+ : m_xContext( xContext ), xProcessor( rxProcessor ), xEnv( rxEnv ),
xOrigEnv( rxOrigEnv ), aArg( rArg ) {}
};
@@ -965,7 +965,7 @@ uno::Reference< io::XInputStream > getInputStream(
try
{
- uno::Reference< io::XOutputStream > xOutputStream( io::Pipe::create(comphelper::getComponentContext(rContext.xSMgr)), uno::UNO_QUERY_THROW );
+ uno::Reference< io::XOutputStream > xOutputStream( io::Pipe::create(rContext.m_xContext), uno::UNO_QUERY_THROW );
ucb::OpenCommandArgument2 aArg;
aArg.Mode = ucb::OpenMode::DOCUMENT;
@@ -1617,7 +1617,7 @@ void globalTransfer_(
rContext.aArg.MimeType );
TransferCommandContext aSubCtx(
- rContext.xSMgr,
+ rContext.m_xContext,
rContext.xProcessor,
rContext.xEnv,
rContext.xOrigEnv,
@@ -1704,11 +1704,8 @@ void UniversalContentBroker::globalTransfer(
uno::Reference< ucb::XCommandEnvironment > xLocalEnv;
if (xEnv.is())
{
- uno::Reference< uno::XComponentContext > xCtx(
- comphelper::getComponentContext( m_xSMgr ) );
-
- xLocalEnv.set( ucb::CommandEnvironment::create(
- xCtx,
+ xLocalEnv.set( ucb::CommandEnvironment::create(
+ m_xContext,
new InteractionHandlerProxy( xEnv->getInteractionHandler() ),
xEnv->getProgressHandler() ) );
}
@@ -1994,7 +1991,7 @@ void UniversalContentBroker::globalTransfer(
}
TransferCommandContext aTransferCtx(
- m_xSMgr, this, xLocalEnv, xEnv, rArg );
+ m_xContext, this, xLocalEnv, xEnv, rArg );
if ( rArg.NewTitle.isEmpty() )
{
@@ -2045,11 +2042,8 @@ uno::Any UniversalContentBroker::checkIn( const ucb::CheckinArgument& rArg,
uno::Reference< ucb::XCommandEnvironment > xLocalEnv;
if (xEnv.is())
{
- uno::Reference< uno::XComponentContext > xCtx(
- comphelper::getComponentContext( m_xSMgr ) );
-
- xLocalEnv.set( ucb::CommandEnvironment::create(
- xCtx,
+ xLocalEnv.set( ucb::CommandEnvironment::create(
+ m_xContext,
new InteractionHandlerProxy( xEnv->getInteractionHandler() ),
xEnv->getProgressHandler() ) );
}
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 319a9457a48b..ee7030c15ff5 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -142,12 +142,12 @@ PropertySetMap_Impl;
class PropertySetInfo_Impl :
public OWeakObject, public XTypeProvider, public XPropertySetInfo
{
- Reference< XMultiServiceFactory > m_xSMgr;
+ Reference< XComponentContext > m_xContext;
Sequence< Property >* m_pProps;
PersistentPropertySet* m_pOwner;
public:
- PropertySetInfo_Impl( const Reference< XMultiServiceFactory >& rxSMgr,
+ PropertySetInfo_Impl( const Reference< XComponentContext >& xContext,
PersistentPropertySet* pOwner );
virtual ~PropertySetInfo_Impl();
@@ -192,8 +192,8 @@ struct UcbStore_Impl
//=========================================================================
//=========================================================================
-UcbStore::UcbStore( const Reference< XMultiServiceFactory >& rXSMgr )
-: m_xSMgr( rXSMgr ),
+UcbStore::UcbStore( const Reference< XComponentContext >& xContext )
+: m_xContext( xContext ),
m_pImpl( new UcbStore_Impl() )
{
}
@@ -235,7 +235,7 @@ XTYPEPROVIDER_IMPL_4( UcbStore,
//
//=========================================================================
-XSERVICEINFO_IMPL_1( UcbStore,
+XSERVICEINFO_IMPL_1_CTX( UcbStore,
OUString( "com.sun.star.comp.ucb.UcbStore" ),
OUString( STORE_SERVICE_NAME ) );
@@ -265,7 +265,7 @@ UcbStore::createPropertySetRegistry( const OUString& )
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
if ( !m_pImpl->m_xTheRegistry.is() )
- m_pImpl->m_xTheRegistry = new PropertySetRegistry( m_xSMgr, getInitArgs() );
+ m_pImpl->m_xTheRegistry = new PropertySetRegistry( m_xContext, getInitArgs() );
}
return m_pImpl->m_xTheRegistry;
@@ -327,9 +327,9 @@ struct PropertySetRegistry_Impl
//=========================================================================
PropertySetRegistry::PropertySetRegistry(
- const Reference< XMultiServiceFactory >& rXSMgr,
+ const Reference< XComponentContext >& xContext,
const Sequence< Any > &rInitArgs )
-: m_xSMgr( rXSMgr ),
+: m_xContext( xContext ),
m_pImpl( new PropertySetRegistry_Impl( rInitArgs ) )
{
}
@@ -412,7 +412,7 @@ PropertySetRegistry::openPropertySet( const OUString& key, sal_Bool create )
// Yep!
return Reference< XPersistentPropertySet >(
new PersistentPropertySet(
- m_xSMgr, *this, key ) );
+ m_xContext, *this, key ) );
}
else if ( create )
{
@@ -460,7 +460,7 @@ PropertySetRegistry::openPropertySet( const OUString& key, sal_Bool create )
return Reference< XPersistentPropertySet >(
new PersistentPropertySet(
- m_xSMgr, *this, key ) );
+ m_xContext, *this, key ) );
}
}
catch (const IllegalArgumentException&)
@@ -1037,9 +1037,7 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider()
{
try
{
- m_pImpl->m_xConfigProvider
- = theDefaultProvider::get(
- comphelper::getComponentContext( m_xSMgr ) );
+ m_pImpl->m_xConfigProvider = theDefaultProvider::get( m_xContext );
}
catch (const Exception&)
{
@@ -1263,10 +1261,10 @@ struct PersistentPropertySet_Impl
//=========================================================================
PersistentPropertySet::PersistentPropertySet(
- const Reference< XMultiServiceFactory >& rXSMgr,
+ const Reference< XComponentContext >& xContext,
PropertySetRegistry& rCreator,
const OUString& rKey )
-: m_xSMgr( rXSMgr ),
+: m_xContext( xContext ),
m_pImpl( new PersistentPropertySet_Impl( rCreator, rKey ) )
{
// register at creator.
@@ -1401,7 +1399,7 @@ Reference< XPropertySetInfo > SAL_CALL
PropertySetInfo_Impl*& rpInfo = m_pImpl->m_pInfo;
if ( !rpInfo )
{
- rpInfo = new PropertySetInfo_Impl( m_xSMgr, this );
+ rpInfo = new PropertySetInfo_Impl( m_xContext, this );
rpInfo->acquire();
}
return Reference< XPropertySetInfo >( rpInfo );
@@ -2361,9 +2359,9 @@ PropertySetRegistry& PersistentPropertySet::getPropertySetRegistry()
//=========================================================================
PropertySetInfo_Impl::PropertySetInfo_Impl(
- const Reference< XMultiServiceFactory >& rxSMgr,
+ const Reference< XComponentContext >& xContext,
PersistentPropertySet* pOwner )
-: m_xSMgr( rxSMgr ),
+: m_xContext( xContext ),
m_pProps( NULL ),
m_pOwner( pOwner )
{
diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx
index 8364bd23dabb..2a9d70a8f42f 100644
--- a/ucb/source/core/ucbstore.hxx
+++ b/ucb/source/core/ucbstore.hxx
@@ -54,13 +54,13 @@ class UcbStore :
public com::sun::star::lang::XInitialization
{
com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ com::sun::star::uno::XComponentContext > m_xContext;
UcbStore_Impl* m_pImpl;
public:
UcbStore(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
+ com::sun::star::uno::XComponentContext >& xContext );
virtual ~UcbStore();
// XInterface
@@ -104,7 +104,7 @@ class PropertySetRegistry :
friend class PersistentPropertySet;
com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ com::sun::star::uno::XComponentContext > m_xContext;
PropertySetRegistry_Impl* m_pImpl;
private:
@@ -120,7 +120,7 @@ private:
public:
PropertySetRegistry(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& rXSMgr,
+ com::sun::star::uno::XComponentContext >& xContext,
const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Any >& rInitArgs);
virtual ~PropertySetRegistry();
@@ -187,7 +187,7 @@ class PersistentPropertySet :
public com::sun::star::beans::XPropertyAccess
{
com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ com::sun::star::uno::XComponentContext > m_xContext;
PersistentPropertySet_Impl* m_pImpl;
private:
@@ -199,7 +199,7 @@ private:
public:
PersistentPropertySet(
const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& rXSMgr,
+ com::sun::star::uno::XComponentContext >& xContext,
PropertySetRegistry& rCreator,
const OUString& rKey );
virtual ~PersistentPropertySet();