diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-08 13:10:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-30 13:59:47 +0100 |
commit | 3d4288c1c0b593421c7f6619c88584bdb7c53337 (patch) | |
tree | f7f4e6e07007bed8c8b77758e61b61d9458cbc28 /ucb | |
parent | 2cf0f6ea36e1525193544258eef2828a54345510 (diff) |
fdo#46808, remove some more XMultiServiceFactory fields
Change-Id: I8d039a933c9fde1a24b35954bb5a1f151e9aa160
Diffstat (limited to 'ucb')
50 files changed, 242 insertions, 252 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index f29125704ca4..6757694bf6c5 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -213,11 +213,11 @@ namespace namespace cmis { - Content::Content( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + Content::Content( const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider *pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, libcmis::ObjectPtr pObject ) throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_pProvider( pProvider ), m_pSession( NULL ), m_pObject( pObject ), @@ -232,11 +232,11 @@ namespace cmis m_sObjectId = m_aURL.getObjectId( ); } - Content::Content( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, + Content::Content( const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider *pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, sal_Bool bIsFolder ) throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_pProvider( pProvider ), m_pSession( NULL ), m_sURL( Identifier->getContentIdentifier( ) ), @@ -351,7 +351,7 @@ namespace cmis const uno::Sequence< beans::Property >& rProperties, const uno::Reference< ucb::XCommandEnvironment >& xEnv ) { - rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_xSMgr ); + rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_xContext ); sal_Int32 nProps; const beans::Property* pProps; @@ -682,7 +682,7 @@ namespace cmis if ( bOpenFolder && bIsFolder ) { uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet(comphelper::getComponentContext(m_xSMgr), this, rOpenCommand, xEnv ); + = new DynamicResultSet(m_xContext, this, rOpenCommand, xEnv ); aRet <<= xSet; } else if ( rOpenCommand.Sink.is() ) @@ -1524,7 +1524,7 @@ namespace cmis try { - return new ::cmis::Content( m_xSMgr, m_pProvider, xId, !create_document ); + return new ::cmis::Content( m_xContext, m_pProvider, xId, !create_document ); } catch ( ucb::ContentCreationException & ) { @@ -1630,7 +1630,7 @@ namespace cmis sPath += STD_TO_OUSTR( ( *it )->getName( ) ); aUrl.setObjectPath( sPath ); uno::Reference< ucb::XContentIdentifier > xId = new ucbhelper::ContentIdentifier( aUrl.asString( ) ); - uno::Reference< ucb::XContent > xContent = new Content( m_xSMgr, m_pProvider, xId, *it ); + uno::Reference< ucb::XContent > xContent = new Content( m_xContext, m_pProvider, xId, *it ); results.push_back( xContent ); } diff --git a/ucb/source/ucp/cmis/cmis_content.hxx b/ucb/source/ucp/cmis/cmis_content.hxx index 42c8482a28fb..b28c3011ae68 100644 --- a/ucb/source/ucp/cmis/cmis_content.hxx +++ b/ucb/source/ucp/cmis/cmis_content.hxx @@ -144,13 +144,13 @@ private: public: Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, libcmis::ObjectPtr pObject = libcmis::ObjectPtr( ) ) throw ( com::sun::star::ucb::ContentCreationException ); Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, sal_Bool bIsFolder) throw ( com::sun::star::ucb::ContentCreationException ); diff --git a/ucb/source/ucp/cmis/cmis_provider.cxx b/ucb/source/ucp/cmis/cmis_provider.cxx index b7febb5382dd..17c57a45b042 100644 --- a/ucb/source/ucp/cmis/cmis_provider.cxx +++ b/ucb/source/ucp/cmis/cmis_provider.cxx @@ -60,12 +60,12 @@ ContentProvider::queryContent( URL aUrl( Identifier->getContentIdentifier( ) ); if ( aUrl.getRepositoryId( ).isEmpty( ) ) { - xContent = new RepoContent( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, Identifier ); + xContent = new RepoContent( m_xContext, this, Identifier ); registerNewContent( xContent ); } else { - xContent = new Content( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, Identifier ); + xContent = new Content( m_xContext, this, Identifier ); registerNewContent( xContent ); } } diff --git a/ucb/source/ucp/cmis/cmis_repo_content.cxx b/ucb/source/ucp/cmis/cmis_repo_content.cxx index 40d7a960cb75..c37d5903e860 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.cxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.cxx @@ -56,11 +56,11 @@ using namespace std; namespace cmis { - RepoContent::RepoContent( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + RepoContent::RepoContent( const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider *pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, list< libcmis::RepositoryPtr > aRepos ) throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_pProvider( pProvider ), m_aURL( Identifier->getContentIdentifier( ) ), m_sRepositoryId( ), @@ -91,7 +91,7 @@ namespace cmis const uno::Sequence< beans::Property >& rProperties, const uno::Reference< ucb::XCommandEnvironment >& xEnv ) { - rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_xSMgr ); + rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_xContext ); sal_Int32 nProps; const beans::Property* pProps; @@ -315,7 +315,7 @@ namespace cmis getRepositories( xEnv ); uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet(comphelper::getComponentContext(m_xSMgr), this, rOpenCommand, xEnv ); + = new DynamicResultSet(m_xContext, this, rOpenCommand, xEnv ); aRet <<= xSet; } else @@ -364,7 +364,7 @@ namespace cmis aUrl.setObjectPath( STD_TO_OUSTR( ( *it )->getId( ) ) ); uno::Reference< ucb::XContentIdentifier > xId = new ucbhelper::ContentIdentifier( aUrl.asString( ) ); - uno::Reference< ucb::XContent > xContent = new RepoContent( m_xSMgr, m_pProvider, xId, m_aRepositories ); + uno::Reference< ucb::XContent > xContent = new RepoContent( m_xContext, m_pProvider, xId, m_aRepositories ); result.push_back( xContent ); } @@ -381,7 +381,7 @@ namespace cmis sUrl = "vnd.libreoffice.cmis://" + sEncodedBinding; uno::Reference< ucb::XContentIdentifier > xId = new ucbhelper::ContentIdentifier( sUrl ); - uno::Reference< ucb::XContent > xContent = new Content( m_xSMgr, m_pProvider, xId ); + uno::Reference< ucb::XContent > xContent = new Content( m_xContext, m_pProvider, xId ); result.push_back( xContent ); } diff --git a/ucb/source/ucp/cmis/cmis_repo_content.hxx b/ucb/source/ucp/cmis/cmis_repo_content.hxx index 2c4a32f3e2b3..176df1b5f6cf 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.hxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.hxx @@ -93,7 +93,7 @@ private: public: RepoContent( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, std::list< libcmis::RepositoryPtr > aRepos = std::list< libcmis::RepositoryPtr > ( ) ) throw ( com::sun::star::ucb::ContentCreationException ); diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index f58895bf4070..9496dcc6a7bc 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -40,7 +40,7 @@ #include <com/sun/star/ucb/OpenMode.hpp> #include <com/sun/star/ucb/XDynamicResultSet.hpp> #include <com/sun/star/lang/IllegalAccessException.hpp> -#include <com/sun/star/deployment/XPackageInformationProvider.hpp> +#include <com/sun/star/deployment/PackageInformationProvider.hpp> #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/propertyvalueset.hxx> @@ -73,6 +73,7 @@ namespace ucb { namespace ucp { namespace ext using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::ucb::XContentIdentifier; using ::com::sun::star::ucb::IllegalIdentifierException; @@ -96,6 +97,7 @@ namespace ucb { namespace ucp { namespace ext using ::com::sun::star::beans::PropertyChangeEvent; using ::com::sun::star::lang::IllegalAccessException; using ::com::sun::star::ucb::CommandInfo; + using ::com::sun::star::deployment::PackageInformationProvider; using ::com::sun::star::deployment::XPackageInformationProvider; /** === end UNO using === **/ namespace OpenMode = ::com::sun::star::ucb::OpenMode; @@ -132,9 +134,9 @@ namespace ucb { namespace ucp { namespace ext //= Content //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - Content::Content( const Reference< XMultiServiceFactory >& i_rORB, ::ucbhelper::ContentProviderImplHelper* i_pProvider, + Content::Content( const Reference< XComponentContext >& rxContext, ::ucbhelper::ContentProviderImplHelper* i_pProvider, const Reference< XContentIdentifier >& i_rIdentifier ) - :Content_Base( i_rORB, i_pProvider, i_rIdentifier ) + :Content_Base( rxContext, i_pProvider, i_rIdentifier ) ,m_eExtContentType( E_UNKNOWN ) ,m_aIsFolder() ,m_aContentType() @@ -271,15 +273,14 @@ namespace ucb { namespace ucp { namespace ext if ( bOpenFolder && impl_isFolder() ) { - Reference< XDynamicResultSet > xSet = new ResultSet( - comphelper::getComponentContext(m_xSMgr), this, aOpenCommand, i_rEvironment ); + Reference< XDynamicResultSet > xSet = new ResultSet( m_xContext, this, aOpenCommand, i_rEvironment ); aRet <<= xSet; } if ( aOpenCommand.Sink.is() ) { const ::rtl::OUString sPhysicalContentURL( getPhysicalURL() ); - ::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEvironment, comphelper::getComponentContext(m_xSMgr) ); + ::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEvironment, m_xContext ); aRet = aRequestedContent.executeCommand( ::rtl::OUString( "open" ), makeAny( aOpenCommand ) ); } } @@ -397,11 +398,11 @@ namespace ucb { namespace ucp { namespace ext } //------------------------------------------------------------------------------------------------------------------ - Reference< XRow > Content::getArtificialNodePropertyValues( const Reference< XMultiServiceFactory >& i_rORB, + Reference< XRow > Content::getArtificialNodePropertyValues( const Reference< XComponentContext >& rxContext, const Sequence< Property >& i_rProperties, const ::rtl::OUString& i_rTitle ) { // note: empty sequence means "get values of all supported properties". - ::rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( i_rORB ); + ::rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( rxContext ); const sal_Int32 nCount = i_rProperties.getLength(); if ( nCount ) @@ -471,9 +472,7 @@ namespace ucb { namespace ucp { namespace ext ENSURE_OR_RETURN( m_eExtContentType != E_ROOT, "illegal call", ::rtl::OUString() ); // create an ucb::XContent for the physical file within the deployed extension - const ::comphelper::ComponentContext aContext( m_xSMgr ); - const Reference< XPackageInformationProvider > xPackageInfo( - aContext.getSingleton( "com.sun.star.deployment.PackageInformationProvider" ), UNO_QUERY_THROW ); + const Reference< XPackageInformationProvider > xPackageInfo = PackageInformationProvider::get(m_xContext); const ::rtl::OUString sPackageLocation( xPackageInfo->getPackageLocation( m_sExtensionId ) ); if ( m_sPathIntoExtension.isEmpty() ) @@ -489,13 +488,13 @@ namespace ucb { namespace ucp { namespace ext switch ( m_eExtContentType ) { case E_ROOT: - return getArtificialNodePropertyValues( m_xSMgr, i_rProperties, ContentProvider::getRootURL() ); + return getArtificialNodePropertyValues( m_xContext, i_rProperties, ContentProvider::getRootURL() ); case E_EXTENSION_ROOT: - return getArtificialNodePropertyValues( m_xSMgr, i_rProperties, m_sExtensionId ); + return getArtificialNodePropertyValues( m_xContext, i_rProperties, m_sExtensionId ); case E_EXTENSION_CONTENT: { const ::rtl::OUString sPhysicalContentURL( getPhysicalURL() ); - ::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEnv, comphelper::getComponentContext(m_xSMgr) ); + ::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEnv, m_xContext ); // translate the property request Sequence< ::rtl::OUString > aPropertyNames( i_rProperties.getLength() ); @@ -506,7 +505,7 @@ namespace ucb { namespace ucp { namespace ext SelectPropertyName() ); const Sequence< Any > aPropertyValues = aRequestedContent.getPropertyValues( aPropertyNames ); - const ::rtl::Reference< ::ucbhelper::PropertyValueSet > xValueRow = new ::ucbhelper::PropertyValueSet( m_xSMgr ); + const ::rtl::Reference< ::ucbhelper::PropertyValueSet > xValueRow = new ::ucbhelper::PropertyValueSet( m_xContext ); sal_Int32 i=0; for ( const Any* value = aPropertyValues.getConstArray(); value != aPropertyValues.getConstArray() + aPropertyValues.getLength(); diff --git a/ucb/source/ucp/ext/ucpext_content.hxx b/ucb/source/ucp/ext/ucpext_content.hxx index a975cdcd0fa4..ee29fd9778a0 100644 --- a/ucb/source/ucp/ext/ucpext_content.hxx +++ b/ucb/source/ucp/ext/ucpext_content.hxx @@ -54,14 +54,14 @@ namespace ucb { namespace ucp { namespace ext { public: Content( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, ::ucbhelper::ContentProviderImplHelper* pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier ); static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getArtificialNodePropertyValues( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, const ::rtl::OUString& rTitle ); diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx index 7456a13ddc17..c276c946527e 100644 --- a/ucb/source/ucp/ext/ucpext_datasupplier.cxx +++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx @@ -22,7 +22,7 @@ #include "ucpext_content.hxx" #include "ucpext_provider.hxx" -#include <com/sun/star/deployment/XPackageInformationProvider.hpp> +#include <com/sun/star/deployment/PackageInformationProvider.hpp> #include <ucbhelper/contentidentifier.hxx> #include <comphelper/componentcontext.hxx> @@ -53,12 +53,14 @@ namespace ucb { namespace ucp { namespace ext using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::ucb::XContent; using ::com::sun::star::ucb::XContentIdentifier; using ::com::sun::star::sdbc::XRow; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::ucb::IllegalIdentifierException; using ::com::sun::star::ucb::ResultSetException; + using ::com::sun::star::deployment::PackageInformationProvider; using ::com::sun::star::deployment::XPackageInformationProvider; using ::com::sun::star::beans::Property; using ::com::sun::star::sdbc::XResultSet; @@ -86,13 +88,13 @@ namespace ucb { namespace ucp { namespace ext ::osl::Mutex m_aMutex; ResultList m_aResults; ::rtl::Reference< Content > m_xContent; - Reference< XMultiServiceFactory > m_xSMgr; + Reference< XComponentContext > m_xContext; sal_Int32 m_nOpenMode; - DataSupplier_Impl( const Reference< XMultiServiceFactory >& i_rORB, const ::rtl::Reference< Content >& i_rContent, + DataSupplier_Impl( const Reference< XComponentContext >& rxContext, const ::rtl::Reference< Content >& i_rContent, const sal_Int32 i_nOpenMode ) :m_xContent( i_rContent ) - ,m_xSMgr( i_rORB ) + ,m_xContext( rxContext ) ,m_nOpenMode( i_nOpenMode ) { } @@ -126,10 +128,10 @@ namespace ucb { namespace ucp { namespace ext //= DataSupplier //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& i_rORB, + DataSupplier::DataSupplier( const Reference< XComponentContext >& rxContext, const ::rtl::Reference< Content >& i_rContent, const sal_Int32 i_nOpenMode ) - :m_pImpl( new DataSupplier_Impl( i_rORB, i_rContent, i_nOpenMode ) ) + :m_pImpl( new DataSupplier_Impl( rxContext, i_rContent, i_nOpenMode ) ) { } @@ -138,9 +140,7 @@ namespace ucb { namespace ucp { namespace ext { try { - const ::comphelper::ComponentContext aContext( m_pImpl->m_xSMgr ); - const Reference< XPackageInformationProvider > xPackageInfo( - aContext.getSingleton( "com.sun.star.deployment.PackageInformationProvider" ), UNO_QUERY_THROW ); + const Reference< XPackageInformationProvider > xPackageInfo = PackageInformationProvider::get( m_pImpl->m_xContext ); const ::rtl::OUString sContentIdentifier( m_pImpl->m_xContent->getIdentifier()->getContentIdentifier() ); @@ -171,7 +171,7 @@ namespace ucb { namespace ucp { namespace ext case E_EXTENSION_CONTENT: { const ::rtl::OUString sPackageLocation( m_pImpl->m_xContent->getPhysicalURL() ); - ::ucbhelper::Content aWrappedContent( sPackageLocation, getResultSet()->getEnvironment(), comphelper::getComponentContext(m_pImpl->m_xSMgr) ); + ::ucbhelper::Content aWrappedContent( sPackageLocation, getResultSet()->getEnvironment(), m_pImpl->m_xContext ); // obtain the properties which our result set is set up for from the wrapped content Sequence< ::rtl::OUString > aPropertyNames(1); @@ -326,7 +326,7 @@ namespace ucb { namespace ucp { namespace ext ::rtl::OUString sTitle = Content::decodeIdentifier( rId.copy( sRootURL.getLength() ) ); if ( !sTitle.isEmpty() && ( sTitle[ sTitle.getLength() - 1 ] == '/' ) ) sTitle = sTitle.copy( 0, sTitle.getLength() - 1 ); - xRow = Content::getArtificialNodePropertyValues( m_pImpl->m_xSMgr, getResultSet()->getProperties(), sTitle ); + xRow = Content::getArtificialNodePropertyValues( m_pImpl->m_xContext, getResultSet()->getProperties(), sTitle ); } break; diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.hxx b/ucb/source/ucp/ext/ucpext_datasupplier.hxx index 707017915249..291b3a17c716 100644 --- a/ucb/source/ucp/ext/ucpext_datasupplier.hxx +++ b/ucb/source/ucp/ext/ucpext_datasupplier.hxx @@ -41,7 +41,7 @@ namespace ucb { namespace ucp { namespace ext { public: DataSupplier( - const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& i_rORB, + const ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, const sal_Int32 nOpenMode ); diff --git a/ucb/source/ucp/ext/ucpext_provider.cxx b/ucb/source/ucp/ext/ucpext_provider.cxx index 0e9de11fc478..9ea4b752555f 100644 --- a/ucb/source/ucp/ext/ucpext_provider.cxx +++ b/ucb/source/ucp/ext/ucpext_provider.cxx @@ -182,7 +182,7 @@ namespace ucb { namespace ucp { namespace ext return xContent; // create a new content - xContent = new Content( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), this, xNormalizedIdentifier ); + xContent = new Content( m_xContext, this, xNormalizedIdentifier ); if ( !xContent->getIdentifier().is() ) throw IllegalIdentifierException(); diff --git a/ucb/source/ucp/ext/ucpext_resultset.cxx b/ucb/source/ucp/ext/ucpext_resultset.cxx index 09759d77df3c..9b6a3b6aaba4 100644 --- a/ucb/source/ucp/ext/ucpext_resultset.cxx +++ b/ucb/source/ucp/ext/ucpext_resultset.cxx @@ -64,7 +64,7 @@ namespace ucb { namespace ucp { namespace ext void ResultSet::initStatic() { ::rtl::Reference< DataSupplier > pDataSupplier( new DataSupplier( - Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), + m_xContext, m_xContent, m_aCommand.Mode ) ); diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index a881b6e69644..7a791ede9093 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -91,11 +91,11 @@ using namespace com::sun::star::sdbc; //========================================================================= //========================================================================= -FTPContent::FTPContent( const Reference< XMultiServiceFactory >& rxSMgr, +FTPContent::FTPContent( const Reference< XComponentContext >& rxContext, FTPContentProvider* pProvider, const Reference< XContentIdentifier >& Identifier, const FTPURL& aFTPURL) - : ContentImplHelper(rxSMgr,pProvider,Identifier), + : ContentImplHelper(rxContext,pProvider,Identifier), m_pFCP(pProvider), m_aFTPURL(aFTPURL), m_bInserted(false), @@ -105,11 +105,11 @@ FTPContent::FTPContent( const Reference< XMultiServiceFactory >& rxSMgr, -FTPContent::FTPContent( const Reference< XMultiServiceFactory >& rxSMgr, +FTPContent::FTPContent( const Reference< XComponentContext >& rxContext, FTPContentProvider* pProvider, const Reference< XContentIdentifier >& Identifier, const ContentInfo& Info) - : ContentImplHelper(rxSMgr,pProvider,Identifier), + : ContentImplHelper(rxContext,pProvider,Identifier), m_pFCP(pProvider), m_aFTPURL(Identifier->getContentIdentifier(), pProvider), @@ -213,13 +213,13 @@ class ResultSetFactoryI { public: - ResultSetFactoryI(const Reference<XMultiServiceFactory >& xSMgr, + ResultSetFactoryI(const Reference<XComponentContext >& rxContext, const Reference<XContentProvider >& xProvider, sal_Int32 nOpenMode, const Sequence<Property>& seq, const Sequence<NumberedSortingInfo>& seqSort, const std::vector<FTPDirentry>& dirvec) - : m_xSMgr(xSMgr), + : m_xContext(rxContext), m_xProvider(xProvider), m_nOpenMode(nOpenMode), m_seq(seq), @@ -230,7 +230,7 @@ public: virtual ResultSetBase* createResultSet() { - return new ResultSetI(m_xSMgr, + return new ResultSetI(m_xContext, m_xProvider, m_nOpenMode, m_seq, @@ -240,7 +240,7 @@ public: public: - Reference< XMultiServiceFactory > m_xSMgr; + Reference< XComponentContext > m_xContext; Reference< XContentProvider > m_xProvider; sal_Int32 m_nOpenMode; Sequence< Property > m_seq; @@ -542,11 +542,11 @@ Any SAL_CALL FTPContent::execute( m_aFTPURL.list(sal_Int16(aOpenCommand.Mode)); Reference< XDynamicResultSet > xSet = new DynamicResultSet( - comphelper::getComponentContext(m_xSMgr), + m_xContext, this, aOpenCommand, Environment, - new ResultSetFactoryI(m_xSMgr, + new ResultSetFactoryI(m_xContext, m_xProvider.get(), aOpenCommand.Mode, aOpenCommand.Properties, @@ -659,7 +659,7 @@ FTPContent::createNewContent( const ContentInfo& Info ) throw (RuntimeException) { if( Info.Type =="application/vnd.sun.staroffice.ftp-file" || Info.Type == "application/vnd.sun.staroffice.ftp-folder" ) - return new FTPContent(m_xSMgr, + return new FTPContent(m_xContext, m_pFCP, m_xIdentifier,Info); else @@ -813,7 +813,7 @@ Reference< XRow > FTPContent::getPropertyValues( ) { rtl::Reference<ucbhelper::PropertyValueSet> xRow = - new ucbhelper::PropertyValueSet(m_xSMgr); + new ucbhelper::PropertyValueSet(m_xContext); FTPDirentry aDirEntry = m_aFTPURL.direntry(); diff --git a/ucb/source/ucp/ftp/ftpcontent.hxx b/ucb/source/ucp/ftp/ftpcontent.hxx index 2597393b5948..c4618ba3af7e 100644 --- a/ucb/source/ucp/ftp/ftpcontent.hxx +++ b/ucb/source/ucp/ftp/ftpcontent.hxx @@ -52,14 +52,14 @@ namespace ftp public: FTPContent( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, FTPContentProvider* pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier, const FTPURL& FtpUrl); FTPContent( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, FTPContentProvider* pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier, diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx index 0f961ecaac8e..0f28bcb3bc4e 100644 --- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx +++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx @@ -154,7 +154,7 @@ FTPContentProvider::queryContent( aURL.host(), aURL.port().toInt32())) { - xContent = new FTPContent( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW), this,xCanonicId,aURL); + xContent = new FTPContent( m_xContext, this,xCanonicId,aURL); registerNewContent(xContent); } else { diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx index 524a6148292b..e812fc139521 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx @@ -38,13 +38,13 @@ using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; -ResultSetI::ResultSetI(const Reference<XMultiServiceFactory>& xMSF, +ResultSetI::ResultSetI(const Reference<XComponentContext>& rxContext, const Reference<XContentProvider>& xProvider, sal_Int32 nOpenMode, const Sequence<Property>& seqProp, const Sequence< NumberedSortingInfo >& seqSort, const std::vector<FTPDirentry>& dirvec) - : ResultSetBase(comphelper::getComponentContext(xMSF),xProvider,nOpenMode,seqProp,seqSort) + : ResultSetBase(rxContext,xProvider,nOpenMode,seqProp,seqSort) { for( unsigned int i = 0; i < dirvec.size(); ++i) m_aPath.push_back(dirvec[i].m_aURL); @@ -56,7 +56,7 @@ ResultSetI::ResultSetI(const Reference<XMultiServiceFactory>& xMSF, for(unsigned n = 0; n < m_aItems.size(); ++n) { rtl::Reference<ucbhelper::PropertyValueSet> xRow = - new ucbhelper::PropertyValueSet(xMSF); + new ucbhelper::PropertyValueSet(rxContext); for( int i = 0; i < seqProp.getLength(); ++i) { const rtl::OUString& Name = seqProp[i].Name; diff --git a/ucb/source/ucp/ftp/ftpresultsetI.hxx b/ucb/source/ucp/ftp/ftpresultsetI.hxx index afba707f77b1..584738c7a8e0 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.hxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.hxx @@ -36,7 +36,7 @@ namespace ftp { ResultSetI( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory>& xMSF, + com::sun::star::uno::XComponentContext>& rxContext, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider>& xProvider, sal_Int32 nOpenMode, diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index d2c1a4af84b2..b675f25109bb 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -83,11 +83,11 @@ namespace gio { Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier) throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_pProvider( pProvider ), mpFile (NULL), mpInfo( NULL ), mbTransient(false) { #if OSL_DEBUG_LEVEL > 1 @@ -96,12 +96,12 @@ Content::Content( } Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, sal_Bool bIsFolder) throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_pProvider( pProvider ), mpFile (NULL), mpInfo( NULL ), mbTransient(true) { #if OSL_DEBUG_LEVEL > 1 @@ -390,11 +390,11 @@ static util::DateTime getDateFromUnix (time_t t) } uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo *pInfo, - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< ucb::XCommandEnvironment > & xEnv, const uno::Sequence< beans::Property >& rProperties) { - rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( rSMgr ); + rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nProps; const beans::Property* pProps; @@ -514,7 +514,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if (!pInfo) ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); - return getPropertyValuesFromGFileInfo(pInfo, m_xSMgr, xEnv, rProperties); + return getPropertyValuesFromGFileInfo(pInfo, m_xContext, xEnv, rProperties); } static lang::IllegalAccessException @@ -855,7 +855,7 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, if ( bOpenFolder && bIsFolder ) { uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet( comphelper::getComponentContext(m_xSMgr), this, rOpenCommand, xEnv ); + = new DynamicResultSet( m_xContext, this, rOpenCommand, xEnv ); aRet <<= xSet; } else if ( rOpenCommand.Sink.is() ) @@ -1163,7 +1163,7 @@ uno::Reference< ucb::XContent > try { - return new ::gio::Content( m_xSMgr, m_pProvider, xId, !create_document ); + return new ::gio::Content( m_xContext, m_pProvider, xId, !create_document ); } catch ( ucb::ContentCreationException & ) { return uno::Reference< ucb::XContent >(); diff --git a/ucb/source/ucp/gio/gio_content.hxx b/ucb/source/ucp/gio/gio_content.hxx index f7f0f2203084..b1cfe0a56996 100644 --- a/ucb/source/ucp/gio/gio_content.hxx +++ b/ucb/source/ucp/gio/gio_content.hxx @@ -119,12 +119,12 @@ private: public: Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier) throw ( com::sun::star::ucb::ContentCreationException ); Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, sal_Bool bIsFolder) throw ( com::sun::star::ucb::ContentCreationException ); @@ -132,7 +132,7 @@ public: virtual ~Content(); com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > getPropertyValuesFromGFileInfo( - GFileInfo *pInfo, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr, + GFileInfo *pInfo, const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv, const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& rProperties); diff --git a/ucb/source/ucp/gio/gio_provider.cxx b/ucb/source/ucp/gio/gio_provider.cxx index bbd7531743ce..93ec2d4d6704 100644 --- a/ucb/source/ucp/gio/gio_provider.cxx +++ b/ucb/source/ucp/gio/gio_provider.cxx @@ -51,8 +51,7 @@ ContentProvider::queryContent( try { - uno::Reference<lang::XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); - xContent = new ::gio::Content(xMSF, this, Identifier); + xContent = new ::gio::Content(m_xContext, this, Identifier); } catch ( com::sun::star::ucb::ContentCreationException const & ) { diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index c3ed8fd197c8..7d29e0f4faa9 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -109,11 +109,11 @@ GnomeToOUString( const char *utf8_str) Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier) throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_pProvider( pProvider ), m_bTransient( sal_False ) { @@ -124,12 +124,12 @@ Content::Content( } Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider * pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, sal_Bool IsFolder) throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_pProvider( pProvider ), m_bTransient( sal_True ) { @@ -343,7 +343,7 @@ uno::Any SAL_CALL Content::execute( if ( bOpenFolder && isFolder( xEnv ) ) { uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet( comphelper::getComponentContext(m_xSMgr), this, aOpenCommand, xEnv ); + = new DynamicResultSet( m_xContext, this, aOpenCommand, xEnv ); aRet <<= xSet; } else if ( aOpenCommand.Sink.is() ) { @@ -517,7 +517,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) ( new ::ucbhelper::ContentIdentifier( aURL ) ); try { - return new ::gvfs::Content( m_xSMgr, m_pProvider, xId, !create_document ); + return new ::gvfs::Content( m_xContext, m_pProvider, xId, !create_document ); } catch ( ucb::ContentCreationException & ) { return uno::Reference< ucb::XContent >(); } @@ -595,7 +595,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( m_xSMgr ); + = new ::ucbhelper::PropertyValueSet( m_xContext ); osl::Guard< osl::Mutex > aGuard( m_aMutex ); for( sal_Int32 n = 0; n < nProps; ++n ) { @@ -1438,7 +1438,7 @@ Content::createTempStream( // Something badly wrong happened - can't seek => stream to a temporary file uno::Reference < io::XOutputStream > xTempOut = uno::Reference < io::XOutputStream > - ( io::TempFile::create(comphelper::getComponentContext(m_xSMgr)), uno::UNO_QUERY ); + ( io::TempFile::create( m_xContext ), uno::UNO_QUERY ); if ( !xTempOut.is() ) cancelCommandExecution( GNOME_VFS_ERROR_IO, xEnv ); diff --git a/ucb/source/ucp/gvfs/gvfs_content.hxx b/ucb/source/ucp/gvfs/gvfs_content.hxx index 49fbf58e0f60..0357987eb4fd 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.hxx +++ b/ucb/source/ucp/gvfs/gvfs_content.hxx @@ -185,13 +185,13 @@ public: public: Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier) throw ( ::com::sun::star::ucb::ContentCreationException ); Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, ContentProvider *pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier, diff --git a/ucb/source/ucp/gvfs/gvfs_provider.cxx b/ucb/source/ucp/gvfs/gvfs_provider.cxx index 8a372ebf713d..442468f7dc78 100644 --- a/ucb/source/ucp/gvfs/gvfs_provider.cxx +++ b/ucb/source/ucp/gvfs/gvfs_provider.cxx @@ -115,7 +115,7 @@ ContentProvider::queryContent( try { - xContent = new ::gvfs::Content(uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, Identifier ); + xContent = new ::gvfs::Content( m_xContext, this, Identifier ); registerNewContent( xContent ); } catch ( com::sun::star::ucb::ContentCreationException const & ) diff --git a/ucb/source/ucp/hierarchy/dynamicresultset.cxx b/ucb/source/ucp/hierarchy/dynamicresultset.cxx index a36d5dff70b5..444886659e95 100644 --- a/ucb/source/ucp/hierarchy/dynamicresultset.cxx +++ b/ucb/source/ucp/hierarchy/dynamicresultset.cxx @@ -62,7 +62,7 @@ void DynamicResultSet::initStatic() = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new HierarchyResultSetDataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new HierarchyResultSetDataSupplier( m_xContext, m_xContent, m_aCommand.Mode ) ); } @@ -74,7 +74,7 @@ void DynamicResultSet::initDynamic() = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new HierarchyResultSetDataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new HierarchyResultSetDataSupplier( m_xContext, m_xContent, m_aCommand.Mode ) ); m_xResultSet2 = m_xResultSet1; diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index 81dd0dc00f04..3676019219fc 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -83,22 +83,22 @@ using namespace hierarchy_ucp; // static ( "virtual" ctor ) HierarchyContent* HierarchyContent::create( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier ) { // Fail, if content does not exist. HierarchyContentProperties aProps; - if ( !loadData( rxSMgr, pProvider, Identifier, aProps ) ) + if ( !loadData( rxContext, pProvider, Identifier, aProps ) ) return 0; - return new HierarchyContent( rxSMgr, pProvider, Identifier, aProps ); + return new HierarchyContent( rxContext, pProvider, Identifier, aProps ); } //========================================================================= // static ( "virtual" ctor ) HierarchyContent* HierarchyContent::create( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const ucb::ContentInfo& Info ) @@ -109,16 +109,16 @@ HierarchyContent* HierarchyContent::create( if ( Info.Type != HIERARCHY_FOLDER_CONTENT_TYPE && Info.Type != HIERARCHY_LINK_CONTENT_TYPE ) return 0; - return new HierarchyContent( rxSMgr, pProvider, Identifier, Info ); + return new HierarchyContent( rxContext, pProvider, Identifier, Info ); } //========================================================================= HierarchyContent::HierarchyContent( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const HierarchyContentProperties& rProps ) -: ContentImplHelper( rxSMgr, pProvider, Identifier ), +: ContentImplHelper( rxContext, pProvider, Identifier ), m_aProps( rProps ), m_eState( PERSISTENT ), m_pProvider( pProvider ), @@ -130,11 +130,11 @@ HierarchyContent::HierarchyContent( //========================================================================= HierarchyContent::HierarchyContent( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const ucb::ContentInfo& Info ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_aProps( Info.Type == HIERARCHY_FOLDER_CONTENT_TYPE ? HierarchyEntryData::FOLDER : HierarchyEntryData::LINK ), m_eState( TRANSIENT ), m_pProvider( pProvider ), @@ -441,7 +441,7 @@ uno::Any SAL_CALL HierarchyContent::execute( } uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet( comphelper::getComponentContext(m_xSMgr), this, aOpenCommand ); + = new DynamicResultSet( m_xContext, this, aOpenCommand ); aRet <<= xSet; } else if ( aCommand.Name == "insert" && ( m_eKind != ROOT ) && !isReadOnly() ) @@ -619,7 +619,7 @@ HierarchyContent::createNewContent( const ucb::ContentInfo& Info ) uno::Reference< ucb::XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aURL ); - return create( m_xSMgr, m_pProvider, xId, Info ); + return create( m_xContext, m_pProvider, xId, Info ); } else { @@ -639,7 +639,7 @@ rtl::OUString HierarchyContent::getParentURL() //========================================================================= //static sal_Bool HierarchyContent::hasData( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier ) { @@ -654,13 +654,13 @@ sal_Bool HierarchyContent::hasData( return sal_True; } - return HierarchyEntry( rxSMgr, pProvider, aURL ).hasData(); + return HierarchyEntry( rxContext, pProvider, aURL ).hasData(); } //========================================================================= //static sal_Bool HierarchyContent::loadData( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, HierarchyContentProperties& rProps ) @@ -675,7 +675,7 @@ sal_Bool HierarchyContent::loadData( } else { - HierarchyEntry aEntry( rxSMgr, pProvider, aURL ); + HierarchyEntry aEntry( rxContext, pProvider, aURL ); HierarchyEntryData aData; if ( !aEntry.getData( aData ) ) return sal_False; @@ -689,7 +689,7 @@ sal_Bool HierarchyContent::loadData( sal_Bool HierarchyContent::storeData() { HierarchyEntry aEntry( - m_xSMgr, m_pProvider, m_xIdentifier->getContentIdentifier() ); + m_xContext, m_pProvider, m_xIdentifier->getContentIdentifier() ); return aEntry.setData( m_aProps.getHierarchyEntryData(), sal_True ); } @@ -699,7 +699,7 @@ sal_Bool HierarchyContent::renameData( const uno::Reference< ucb::XContentIdentifier >& xNewId ) { HierarchyEntry aEntry( - m_xSMgr, m_pProvider, xOldId->getContentIdentifier() ); + m_xContext, m_pProvider, xOldId->getContentIdentifier() ); return aEntry.move( xNewId->getContentIdentifier(), m_aProps.getHierarchyEntryData() ); } @@ -708,7 +708,7 @@ sal_Bool HierarchyContent::renameData( sal_Bool HierarchyContent::removeData() { HierarchyEntry aEntry( - m_xSMgr, m_pProvider, m_xIdentifier->getContentIdentifier() ); + m_xContext, m_pProvider, m_xIdentifier->getContentIdentifier() ); return aEntry.remove(); } @@ -913,7 +913,7 @@ sal_Bool HierarchyContent::exchangeIdentity( //========================================================================= // static uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, const HierarchyContentProperties& rData, HierarchyContentProvider* pProvider, @@ -922,7 +922,7 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( // Note: Empty sequence means "get values of all supported properties". rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -1066,7 +1066,7 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( const uno::Sequence< beans::Property >& rProperties ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - return getPropertyValues( m_xSMgr, + return getPropertyValues( m_xContext, rProperties, m_aProps, m_pProvider, @@ -1795,7 +1795,7 @@ void HierarchyContent::transfer( if ( xSource->isFolder() ) { HierarchyEntry aFolder( - m_xSMgr, m_pProvider, xId->getContentIdentifier() ); + m_xContext, m_pProvider, xId->getContentIdentifier() ); HierarchyEntry::iterator it; while ( aFolder.next( it ) ) diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.hxx b/ucb/source/ucp/hierarchy/hierarchycontent.hxx index 052c62bb9827..eb333ee7c98c 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.hxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.hxx @@ -124,14 +124,14 @@ class HierarchyContent : public ::ucbhelper::ContentImplHelper, private: HierarchyContent( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, const HierarchyContentProperties& rProps ); HierarchyContent( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -147,17 +147,17 @@ private: static sal_Bool hasData( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier ); sal_Bool hasData( const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier ) - { return hasData( m_xSMgr, m_pProvider, Identifier ); } + { return hasData( m_xContext, m_pProvider, Identifier ); } static sal_Bool loadData( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -218,7 +218,7 @@ public: // Create existing content. Fail, if not already exists. static HierarchyContent* create( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier ); @@ -226,7 +226,7 @@ public: // Create new content. Fail, if already exists. static HierarchyContent* create( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -290,7 +290,7 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, const HierarchyContentProperties& rData, diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index 7fbae5c73d1e..bac029246a21 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -109,10 +109,10 @@ void makeXMLName( const rtl::OUString & rIn, rtl::OUStringBuffer & rBuffer ) //========================================================================= HierarchyEntry::HierarchyEntry( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const rtl::OUString& rURL ) -: m_xSMgr( rSMgr ), +: m_xContext( rxContext ), m_xOfficeInstDirs( pProvider->getOfficeInstallationDirectories() ), m_bTriedToGetRootReadAccess( sal_False ) { @@ -128,7 +128,7 @@ HierarchyEntry::HierarchyEntry( } // Note: do not init m_aPath in init list. createPathFromHierarchyURL - // needs m_xSMgr and m_aMutex. + // needs m_xContext and m_aMutex. m_aPath = createPathFromHierarchyURL( aUri ); // Extract language independent name from URL. @@ -269,7 +269,7 @@ sal_Bool HierarchyEntry::setData( if ( !m_xConfigProvider.is() ) m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( - m_xSMgr->createInstance( m_aServiceSpecifier ), + m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); if ( m_xConfigProvider.is() ) @@ -524,7 +524,7 @@ sal_Bool HierarchyEntry::move( { if ( !m_xConfigProvider.is() ) m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( - m_xSMgr->createInstance( m_aServiceSpecifier ), + m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); if ( !m_xConfigProvider.is() ) @@ -794,7 +794,7 @@ sal_Bool HierarchyEntry::remove() if ( !m_xConfigProvider.is() ) m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( - m_xSMgr->createInstance( m_aServiceSpecifier ), + m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); if ( m_xConfigProvider.is() ) @@ -1050,7 +1050,7 @@ HierarchyEntry::getRootReadAccess() if ( !m_xConfigProvider.is() ) m_xConfigProvider = uno::Reference< lang::XMultiServiceFactory >( - m_xSMgr->createInstance( m_aServiceSpecifier ), + m_xContext->getServiceManager()->createInstanceWithContext(m_aServiceSpecifier, m_xContext), uno::UNO_QUERY ); if ( m_xConfigProvider.is() ) diff --git a/ucb/source/ucp/hierarchy/hierarchydata.hxx b/ucb/source/ucp/hierarchy/hierarchydata.hxx index fd87bc940d79..9c93957fb102 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.hxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.hxx @@ -23,6 +23,7 @@ #include <rtl/ustring.hxx> #include <osl/mutex.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> namespace com { namespace sun { namespace star { namespace container { @@ -81,7 +82,7 @@ class HierarchyEntry ::rtl::OUString m_aPath; ::osl::Mutex m_aMutex; ::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::lang::XMultiServiceFactory > m_xConfigProvider; ::com::sun::star::uno::Reference< @@ -100,7 +101,7 @@ private: public: HierarchyEntry( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, HierarchyContentProvider* pProvider, const ::rtl::OUString& rURL ); diff --git a/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx b/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx index bf85e374dd4f..f0dd1699ee6c 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx @@ -72,18 +72,18 @@ struct DataSupplier_Impl osl::Mutex m_aMutex; ResultList m_aResults; rtl::Reference< HierarchyContent > m_xContent; - uno::Reference< lang::XMultiServiceFactory > m_xSMgr; + uno::Reference< uno::XComponentContext > m_xContext; HierarchyEntry m_aFolder; HierarchyEntry::iterator m_aIterator; sal_Int32 m_nOpenMode; sal_Bool m_bCountFinal; DataSupplier_Impl( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< HierarchyContent >& rContent, sal_Int32 nOpenMode ) - : m_xContent( rContent ), m_xSMgr( rxSMgr ), - m_aFolder( rxSMgr, + : m_xContent( rContent ), m_xContext( rxContext ), + m_aFolder( rxContext, static_cast< HierarchyContentProvider * >( rContent->getProvider().get() ), rContent->getIdentifier()->getContentIdentifier() ), @@ -115,10 +115,10 @@ DataSupplier_Impl::~DataSupplier_Impl() //========================================================================= HierarchyResultSetDataSupplier::HierarchyResultSetDataSupplier( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< HierarchyContent >& rContent, sal_Int32 nOpenMode ) -: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) ) +: m_pImpl( new DataSupplier_Impl( rxContext, rContent, nOpenMode ) ) { } @@ -363,7 +363,7 @@ HierarchyResultSetDataSupplier::queryPropertyValues( sal_uInt32 nIndex ) uno::Reference< sdbc::XRow > xRow = HierarchyContent::getPropertyValues( - m_pImpl->m_xSMgr, + m_pImpl->m_xContext, getResultSet()->getProperties(), aData, static_cast< HierarchyContentProvider * >( diff --git a/ucb/source/ucp/hierarchy/hierarchydatasupplier.hxx b/ucb/source/ucp/hierarchy/hierarchydatasupplier.hxx index d9900cdcb2e8..28c1a5061c46 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasupplier.hxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasupplier.hxx @@ -41,7 +41,7 @@ private: public: HierarchyResultSetDataSupplier( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, const rtl::Reference< HierarchyContent >& rContent, sal_Int32 nOpenMode = com::sun::star::ucb::OpenMode::ALL ); virtual ~HierarchyResultSetDataSupplier(); diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx index e528dad6f336..0fc6ec64c89a 100644 --- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx @@ -130,7 +130,7 @@ HierarchyContentProvider::queryContent( return xContent; // Create a new content. - xContent = HierarchyContent::create( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, xCanonicId ); + xContent = HierarchyContent::create( m_xContext, this, xCanonicId ); registerNewContent( xContent ); if ( xContent.is() && !xContent->getIdentifier().is() ) diff --git a/ucb/source/ucp/odma/odma_content.cxx b/ucb/source/ucp/odma/odma_content.cxx index 64494e312563..be1e48f8bea3 100644 --- a/ucb/source/ucp/odma/odma_content.cxx +++ b/ucb/source/ucp/odma/odma_content.cxx @@ -569,7 +569,7 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) //========================================================================= // static uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, const rtl::Reference<ContentProperties>& rData, const rtl::Reference< ::ucbhelper::ContentProviderImplHelper >& rProvider, @@ -578,7 +578,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Note: Empty sequence means "get values of all supported properties". rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -768,7 +768,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( const uno::Reference< ucb::XCommandEnvironment >& /*xEnv*/ ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - return getPropertyValues( m_xSMgr, + return getPropertyValues( comphelper::getComponentContext(m_xSMgr), rProperties, m_aProps, rtl::Reference< diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 5d920e0cfb32..389f67ca1690 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -147,7 +147,7 @@ ContentProperties::getCreatableContentsInfo( PackageUri const & rUri ) const // static ( "virtual" ctor ) Content* Content::create( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier ) { @@ -170,7 +170,7 @@ Content* Content::create( uno::Reference< ucb::XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aURI.getUri() ); - return new Content( rxSMgr, pProvider, xId, xPackage, aURI, aProps ); + return new Content( rxContext, pProvider, xId, xPackage, aURI, aProps ); } else { @@ -192,14 +192,14 @@ Content* Content::create( else aInfo.Type = getContentType( aURI.getScheme(), sal_False ); - return new Content( rxSMgr, pProvider, xId, xPackage, aURI, aInfo ); + return new Content( rxContext, pProvider, xId, xPackage, aURI, aInfo ); } } //========================================================================= // static ( "virtual" ctor ) Content* Content::create( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const ucb::ContentInfo& Info ) @@ -221,7 +221,7 @@ Content* Content::create( uno::Reference< ucb::XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aURI.getUri() ); - return new Content( rxSMgr, pProvider, xId, xPackage, aURI, Info ); + return new Content( rxContext, pProvider, xId, xPackage, aURI, Info ); } //========================================================================= @@ -238,13 +238,13 @@ Content* Content::create( //========================================================================= Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const uno::Reference< container::XHierarchicalNameAccess > & Package, const PackageUri& rUri, const ContentProperties& rProps ) -: ContentImplHelper( rxSMgr, pProvider, Identifier ), +: ContentImplHelper( rxContext, pProvider, Identifier ), m_aUri( rUri ), m_aProps( rProps ), m_eState( PERSISTENT ), @@ -256,13 +256,13 @@ Content::Content( //========================================================================= Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const uno::Reference< container::XHierarchicalNameAccess > & Package, const PackageUri& rUri, const ucb::ContentInfo& Info ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_aUri( rUri ), m_aProps( Info.Type ), m_eState( TRANSIENT ), @@ -739,7 +739,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) uno::Reference< ucb::XContentIdentifier > xId( new ::ucbhelper::ContentIdentifier( aURL ) ); - return create( m_xSMgr, m_pProvider, xId, Info ); + return create( m_xContext, m_pProvider, xId, Info ); } else { @@ -763,7 +763,7 @@ rtl::OUString Content::getParentURL() //========================================================================= // static uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, ContentProvider* pProvider, const rtl::OUString& rContentId ) @@ -772,7 +772,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( uno::Reference< container::XHierarchicalNameAccess > xPackage; if ( loadData( pProvider, PackageUri( rContentId ), aData, xPackage ) ) { - return getPropertyValues( rSMgr, + return getPropertyValues( rxContext, rProperties, aData, rtl::Reference< @@ -783,7 +783,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else { rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -800,7 +800,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( //========================================================================= // static uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, const ContentProperties& rData, const rtl::Reference< ::ucbhelper::ContentProviderImplHelper >& @@ -810,7 +810,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Note: Empty sequence means "get values of all supported properties". rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -1028,7 +1028,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( const uno::Sequence< beans::Property >& rProperties ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - return getPropertyValues( m_xSMgr, + return getPropertyValues( m_xContext, rProperties, m_aProps, rtl::Reference< @@ -1462,7 +1462,7 @@ uno::Any Content::open( ////////////////////////////////////////////////////////////////// uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet( comphelper::getComponentContext(m_xSMgr), this, rArg, xEnv ); + = new DynamicResultSet( m_xContext, this, rArg, xEnv ); return uno::makeAny( xSet ); } else diff --git a/ucb/source/ucp/package/pkgcontent.hxx b/ucb/source/ucp/package/pkgcontent.hxx index 9a3d3f49ac18..1d5db315f9a7 100644 --- a/ucb/source/ucp/package/pkgcontent.hxx +++ b/ucb/source/ucp/package/pkgcontent.hxx @@ -115,7 +115,7 @@ class Content : public ::ucbhelper::ContentImplHelper, private: Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -124,7 +124,7 @@ private: const PackageUri& rUri, const ContentProperties& rProps ); Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -143,7 +143,7 @@ private: static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, const ContentProperties& rData, @@ -238,7 +238,7 @@ public: // Create existing content. Fail, if not already exists. static Content* create( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier ); @@ -246,7 +246,7 @@ public: // Create new content. Fail, if already exists. static Content* create( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -307,7 +307,7 @@ public: // Called from resultset data supplier. static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, ContentProvider* pProvider, diff --git a/ucb/source/ucp/package/pkgdatasupplier.cxx b/ucb/source/ucp/package/pkgdatasupplier.cxx index e49b343053e6..74fbaa9f434a 100644 --- a/ucb/source/ucp/package/pkgdatasupplier.cxx +++ b/ucb/source/ucp/package/pkgdatasupplier.cxx @@ -77,17 +77,17 @@ struct DataSupplier_Impl osl::Mutex m_aMutex; ResultList m_aResults; rtl::Reference< Content > m_xContent; - uno::Reference< lang::XMultiServiceFactory > m_xSMgr; + uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< container::XEnumeration > m_xFolderEnum; sal_Int32 m_nOpenMode; sal_Bool m_bCountFinal; sal_Bool m_bThrowException; DataSupplier_Impl( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) - : m_xContent( rContent ), m_xSMgr( rxSMgr ), + : m_xContent( rContent ), m_xContext( rxContext ), m_xFolderEnum( rContent->getIterator() ), m_nOpenMode( nOpenMode ), m_bCountFinal( !m_xFolderEnum.is() ), m_bThrowException( m_bCountFinal ) {} @@ -118,10 +118,10 @@ DataSupplier_Impl::~DataSupplier_Impl() //========================================================================= DataSupplier::DataSupplier( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) -: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) ) +: m_pImpl( new DataSupplier_Impl( rxContext, rContent, nOpenMode ) ) { } @@ -413,7 +413,7 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( if ( getResult( nIndex ) ) { uno::Reference< sdbc::XRow > xRow = Content::getPropertyValues( - m_pImpl->m_xSMgr, + m_pImpl->m_xContext, getResultSet()->getProperties(), static_cast< ContentProvider * >( m_pImpl->m_xContent->getProvider().get() ), diff --git a/ucb/source/ucp/package/pkgdatasupplier.hxx b/ucb/source/ucp/package/pkgdatasupplier.hxx index 189fb55672ed..871ca6e4cdc7 100644 --- a/ucb/source/ucp/package/pkgdatasupplier.hxx +++ b/ucb/source/ucp/package/pkgdatasupplier.hxx @@ -34,7 +34,7 @@ class DataSupplier : public ::ucbhelper::ResultSetDataSupplier public: DataSupplier( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ); virtual ~DataSupplier(); diff --git a/ucb/source/ucp/package/pkgprovider.cxx b/ucb/source/ucp/package/pkgprovider.cxx index c373d5408b98..605851a25869 100644 --- a/ucb/source/ucp/package/pkgprovider.cxx +++ b/ucb/source/ucp/package/pkgprovider.cxx @@ -216,7 +216,7 @@ uno::Reference< ucb::XContent > SAL_CALL ContentProvider::queryContent( // Create a new content. - xContent = Content::create( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, Identifier ); // not xId!!! + xContent = Content::create( m_xContext, this, Identifier ); // not xId!!! registerNewContent( xContent ); if ( xContent.is() && !xContent->getIdentifier().is() ) diff --git a/ucb/source/ucp/package/pkgresultset.cxx b/ucb/source/ucp/package/pkgresultset.cxx index fb7357328f4e..e6f5b0e347d3 100644 --- a/ucb/source/ucp/package/pkgresultset.cxx +++ b/ucb/source/ucp/package/pkgresultset.cxx @@ -64,7 +64,7 @@ void DynamicResultSet::initStatic() m_xResultSet1 = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new DataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new DataSupplier( m_xContext, m_xContent, m_aCommand.Mode ), m_xEnv ); @@ -76,7 +76,7 @@ void DynamicResultSet::initDynamic() m_xResultSet1 = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new DataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new DataSupplier( m_xContext, m_xContent, m_aCommand.Mode ), m_xEnv ); diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 9946fea42067..c067b6257173 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -98,7 +98,7 @@ static ContentType lcl_getContentType( const rtl::OUString & rType ) // static ( "virtual" ctor ) Content* Content::create( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier ) { @@ -109,13 +109,13 @@ Content* Content::create( aProps ) ) return 0; - return new Content( rxSMgr, pProvider, Identifier, aProps ); + return new Content( rxContext, pProvider, Identifier, aProps ); } //========================================================================= // static ( "virtual" ctor ) Content* Content::create( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const ucb::ContentInfo& Info ) @@ -129,16 +129,16 @@ Content* Content::create( return 0; } - return new Content( rxSMgr, pProvider, Identifier, Info ); + return new Content( rxContext, pProvider, Identifier, Info ); } //========================================================================= Content::Content( - const uno::Reference< lang::XMultiServiceFactory > & rxSMgr, + const uno::Reference< uno::XComponentContext > & rxContext, ContentProvider * pProvider, const uno::Reference< ucb::XContentIdentifier > & Identifier, const ContentProperties & rProps ) -: ContentImplHelper( rxSMgr, pProvider, Identifier ), +: ContentImplHelper( rxContext, pProvider, Identifier ), m_aProps( rProps ), m_eState( PERSISTENT ), m_pProvider( pProvider ) @@ -148,11 +148,11 @@ Content::Content( //========================================================================= // ctor for a content just created via XContentCreator::createNewContent() Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, const ucb::ContentInfo& Info ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), + : ContentImplHelper( rxContext, pProvider, Identifier ), m_aProps( lcl_getContentType( Info.Type ), rtl::OUString() ), // no Title (yet) m_eState( TRANSIENT ), m_pProvider( pProvider ) @@ -727,7 +727,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) uno::Reference< ucb::XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aURL ); - return create( m_xSMgr, m_pProvider, xId, Info ); + return create( m_xContext, m_pProvider, xId, Info ); } else { @@ -899,7 +899,7 @@ sal_Bool Content::exchangeIdentity( //========================================================================= // static uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, ContentProvider* pProvider, const rtl::OUString& rContentId ) @@ -908,12 +908,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( loadData( pProvider, rContentId, aData ) ) { return getPropertyValues( - rSMgr, rProperties, aData, pProvider, rContentId ); + rxContext, rProperties, aData, pProvider, rContentId ); } else { rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -930,7 +930,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( //========================================================================= // static uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, const ContentProperties& rData, ContentProvider* pProvider, @@ -939,7 +939,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Note: Empty sequence means "get values of all supported properties". rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -1119,7 +1119,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( const uno::Sequence< beans::Property >& rProperties ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - return getPropertyValues( m_xSMgr, + return getPropertyValues( m_xContext, rProperties, m_aProps, m_pProvider, @@ -1418,7 +1418,7 @@ uno::Any Content::open( ////////////////////////////////////////////////////////////////// uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet( comphelper::getComponentContext(m_xSMgr), this, rArg ); + = new DynamicResultSet( m_xContext, this, rArg ); return uno::makeAny( xSet ); } else diff --git a/ucb/source/ucp/tdoc/tdoc_content.hxx b/ucb/source/ucp/tdoc/tdoc_content.hxx index 9ce328e37b44..a1b25abb043a 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.hxx +++ b/ucb/source/ucp/tdoc/tdoc_content.hxx @@ -113,13 +113,13 @@ class Content : public ::ucbhelper::ContentImplHelper, private: Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, const ContentProperties & rProps ); Content( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -201,7 +201,7 @@ private: static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, const ContentProperties& rData, @@ -244,7 +244,7 @@ public: // Create existing content. Fail, if not already exists. static Content* create( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier ); @@ -252,7 +252,7 @@ public: // Create new content. Fail, if already exists. static Content* create( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -316,7 +316,7 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, ContentProvider* pProvider, diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx index 7bbccdaee6fd..65daafdcf784 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx @@ -73,17 +73,17 @@ struct DataSupplier_Impl osl::Mutex m_aMutex; ResultList m_aResults; rtl::Reference< Content > m_xContent; - uno::Reference< lang::XMultiServiceFactory > m_xSMgr; + uno::Reference< uno::XComponentContext > m_xContext; uno::Sequence< rtl::OUString > * m_pNamesOfChildren; sal_Int32 m_nOpenMode; bool m_bCountFinal; bool m_bThrowException; DataSupplier_Impl( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) - : m_xContent( rContent ), m_xSMgr( rxSMgr ), + : m_xContent( rContent ), m_xContext( rxContext ), m_pNamesOfChildren( 0 ), m_nOpenMode( nOpenMode ), m_bCountFinal( false ), m_bThrowException( false ) {} @@ -116,10 +116,10 @@ DataSupplier_Impl::~DataSupplier_Impl() //========================================================================= ResultSetDataSupplier::ResultSetDataSupplier( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) -: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) ) +: m_pImpl( new DataSupplier_Impl( rxContext, rContent, nOpenMode ) ) { } @@ -377,7 +377,7 @@ ResultSetDataSupplier::queryPropertyValues( sal_uInt32 nIndex ) if ( getResult( nIndex ) ) { uno::Reference< sdbc::XRow > xRow = Content::getPropertyValues( - m_pImpl->m_xSMgr, + m_pImpl->m_xContext, getResultSet()->getProperties(), m_pImpl->m_xContent->getContentProvider().get(), queryContentIdentifierString( nIndex ) ); diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx index 0d1d8adbcdd3..93a3f8c52eef 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx @@ -40,7 +40,7 @@ private: public: ResultSetDataSupplier( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode = com::sun::star::ucb::OpenMode::ALL ); virtual ~ResultSetDataSupplier(); diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index f9b5ba9010ee..d5fbb0b6ea2a 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -141,7 +141,7 @@ ContentProvider::queryContent( if ( !xContent.is() ) { // Create a new content. - xContent = Content::create( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, xCanonicId ); + xContent = Content::create( m_xContext, this, xCanonicId ); registerNewContent( xContent ); } @@ -182,7 +182,7 @@ ContentProvider::createDocumentContent( if ( !xContent.is() ) { // Create a new content. - xContent = Content::create( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, xId ); + xContent = Content::create( m_xContext, this, xId ); } if ( xContent.is() ) diff --git a/ucb/source/ucp/tdoc/tdoc_resultset.cxx b/ucb/source/ucp/tdoc/tdoc_resultset.cxx index 7ec9c2326266..d942e7c65cc6 100644 --- a/ucb/source/ucp/tdoc/tdoc_resultset.cxx +++ b/ucb/source/ucp/tdoc/tdoc_resultset.cxx @@ -66,7 +66,7 @@ void DynamicResultSet::initStatic() = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new ResultSetDataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new ResultSetDataSupplier( m_xContext, m_xContent, m_aCommand.Mode ) ); } @@ -78,7 +78,7 @@ void DynamicResultSet::initDynamic() = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new ResultSetDataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new ResultSetDataSupplier( m_xContext, m_xContent, m_aCommand.Mode ) ); m_xResultSet2 = m_xResultSet1; diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index c0d7ace4bf71..a00763e7540d 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -102,12 +102,12 @@ using namespace webdav_ucp; //========================================================================= // ctr for content on an existing webdav resource Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, rtl::Reference< DAVSessionFactory > const & rSessionFactory ) throw ( ucb::ContentCreationException ) -: ContentImplHelper( rxSMgr, pProvider, Identifier ), +: ContentImplHelper( rxContext, pProvider, Identifier ), m_eResourceType( UNKNOWN ), m_pProvider( pProvider ), m_bTransient( false ), @@ -117,7 +117,7 @@ Content::Content( try { m_xResAccess.reset( new DAVResourceAccess( - comphelper::getComponentContext(rxSMgr), + rxContext, rSessionFactory, Identifier->getContentIdentifier() ) ); @@ -133,13 +133,13 @@ Content::Content( //========================================================================= // ctr for content on an non-existing webdav resource Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, ContentProvider* pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier, rtl::Reference< DAVSessionFactory > const & rSessionFactory, sal_Bool isCollection ) throw ( ucb::ContentCreationException ) -: ContentImplHelper( rxSMgr, pProvider, Identifier ), +: ContentImplHelper( rxContext, pProvider, Identifier ), m_eResourceType( UNKNOWN ), m_pProvider( pProvider ), m_bTransient( true ), @@ -149,7 +149,7 @@ Content::Content( try { m_xResAccess.reset( new DAVResourceAccess( - comphelper::getComponentContext(rxSMgr), rSessionFactory, Identifier->getContentIdentifier() ) ); + rxContext, rSessionFactory, Identifier->getContentIdentifier() ) ); } catch ( DAVException const & ) { @@ -200,11 +200,8 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) { try { - uno::Reference< uno::XComponentContext > xCtx( - comphelper::getComponentContext( m_xSMgr ) ); - uno::Reference< task::XInteractionHandler > xIH( - task::PasswordContainerInteractionHandler::create( xCtx ) ); + task::PasswordContainerInteractionHandler::create( m_xContext ) ); // Supply a command env to isFolder() that contains an interaction // handler that uses the password container service to obtain @@ -212,7 +209,7 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) uno::Reference< ucb::XCommandEnvironment > xCmdEnv( ucb::CommandEnvironment::create( - xCtx, + m_xContext, xIH, uno::Reference< ucb::XProgressHandler >() ) ); @@ -997,7 +994,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) // create the local content try { - return new ::webdav_ucp::Content( m_xSMgr, + return new ::webdav_ucp::Content( m_xContext, m_pProvider, xId, m_xResAccess->getSessionFactory(), @@ -1047,7 +1044,7 @@ rtl::OUString Content::getParentURL() // static uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, const ContentProperties& rData, const rtl::Reference< ::ucbhelper::ContentProviderImplHelper >& rProvider, @@ -1056,7 +1053,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Note: Empty sequence means "get values of all supported properties". rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -1143,7 +1140,6 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( SAL_WNODEPRECATED_DECLARATIONS_POP rtl::OUString aUnescapedTitle; bool bHasAll = false; - uno::Reference< lang::XMultiServiceFactory > xSMgr; uno::Reference< ucb::XContentIdentifier > xIdentifier; rtl::Reference< ::ucbhelper::ContentProviderImplHelper > xProvider; @@ -1151,7 +1147,6 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( osl::Guard< osl::Mutex > aGuard( m_aMutex ); aUnescapedTitle = NeonUri::unescape( m_aEscapedTitle ); - xSMgr.set( m_xSMgr ); xIdentifier.set( m_xIdentifier ); xProvider.set( m_xProvider.get() ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -1421,7 +1416,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } uno::Reference< sdbc::XRow > xResultRow - = getPropertyValues( xSMgr, + = getPropertyValues( m_xContext, rProperties, *xProps, xProvider, @@ -1448,7 +1443,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) throw ( uno::Exception ) { - uno::Reference< lang::XMultiServiceFactory > xSMgr; uno::Reference< ucb::XContentIdentifier > xIdentifier; rtl::Reference< ContentProvider > xProvider; sal_Bool bTransient; @@ -1463,7 +1457,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues( xIdentifier.set( m_xIdentifier ); bTransient = m_bTransient; xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); - xSMgr.set( m_xSMgr ); } uno::Sequence< uno::Any > aRet( rValues.getLength() ); @@ -1854,7 +1847,7 @@ uno::Any Content::open( // Open collection. uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet( comphelper::getComponentContext(m_xSMgr), this, rArg, xEnv ); + = new DynamicResultSet( m_xContext, this, rArg, xEnv ); aRet <<= xSet; } else @@ -2411,7 +2404,6 @@ void Content::transfer( const uno::Reference< ucb::XCommandEnvironment >& Environment ) throw( uno::Exception ) { - uno::Reference< lang::XMultiServiceFactory > xSMgr; uno::Reference< ucb::XContentIdentifier > xIdentifier; uno::Reference< ucb::XContentProvider > xProvider; SAL_WNODEPRECATED_DECLARATIONS_PUSH @@ -2421,7 +2413,6 @@ void Content::transfer( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - xSMgr.set( m_xSMgr ); xIdentifier.set( m_xIdentifier ); xProvider.set( m_xProvider.get() ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -2513,7 +2504,7 @@ void Content::transfer( uno::Reference< ucb::XContentIdentifier > xTargetId = new ::ucbhelper::ContentIdentifier( aTargetURL ); - DAVResourceAccess aSourceAccess( comphelper::getComponentContext(xSMgr), + DAVResourceAccess aSourceAccess( m_xContext, xResAccess->getSessionFactory(), sourceURI.GetURI() ); diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx b/ucb/source/ucp/webdav-neon/webdavcontent.hxx index 790e0de83a0d..637ab7f22df5 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx @@ -204,14 +204,14 @@ private: public: Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier, rtl::Reference< DAVSessionFactory > const & rSessionFactory ) throw ( ::com::sun::star::ucb::ContentCreationException ); Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, ContentProvider* pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier, @@ -292,7 +292,7 @@ public: // Called from resultset data supplier. static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, const ContentProperties& rData, diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx index f5f662062973..ef466898eee0 100644 --- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx @@ -85,16 +85,16 @@ struct DataSupplier_Impl osl::Mutex m_aMutex; ResultList m_aResults; rtl::Reference< Content > m_xContent; - uno::Reference< lang::XMultiServiceFactory > m_xSMgr; + uno::Reference< uno::XComponentContext > m_xContext; sal_Int32 m_nOpenMode; sal_Bool m_bCountFinal; sal_Bool m_bThrowException; DataSupplier_Impl( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) - : m_xContent( rContent ), m_xSMgr( rxSMgr ), m_nOpenMode( nOpenMode ), + : m_xContent( rContent ), m_xContext( rxContext ), m_nOpenMode( nOpenMode ), m_bCountFinal( sal_False ), m_bThrowException( sal_False ) {} ~DataSupplier_Impl(); }; @@ -123,10 +123,10 @@ DataSupplier_Impl::~DataSupplier_Impl() //========================================================================= DataSupplier::DataSupplier( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) -: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) ) +: m_pImpl( new DataSupplier_Impl( rxContext, rContent, nOpenMode ) ) { } @@ -310,7 +310,7 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( { uno::Reference< sdbc::XRow > xRow = Content::getPropertyValues( - m_pImpl->m_xSMgr, + m_pImpl->m_xContext, getResultSet()->getProperties(), *(m_pImpl->m_aResults[ nIndex ]->pData), rtl::Reference< ::ucbhelper::ContentProviderImplHelper >( diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.hxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.hxx index 582bab2d698c..eb0f82c16629 100644 --- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.hxx +++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.hxx @@ -47,7 +47,7 @@ private: public: DataSupplier( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + com::sun::star::uno::XComponentContext >& rxContext, const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode); diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.cxx b/ucb/source/ucp/webdav-neon/webdavprovider.cxx index 49ee82c1d5fb..01b919cc71f0 100644 --- a/ucb/source/ucp/webdav-neon/webdavprovider.cxx +++ b/ucb/source/ucp/webdav-neon/webdavprovider.cxx @@ -198,7 +198,7 @@ ContentProvider::queryContent( try { xContent = new ::webdav_ucp::Content( - uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), this, xCanonicId, m_xDAVSessionFactory ); + m_xContext, this, xCanonicId, m_xDAVSessionFactory ); registerNewContent( xContent ); } catch ( ucb::ContentCreationException const & ) diff --git a/ucb/source/ucp/webdav-neon/webdavresultset.cxx b/ucb/source/ucp/webdav-neon/webdavresultset.cxx index f069854e5c8c..332071614fc0 100644 --- a/ucb/source/ucp/webdav-neon/webdavresultset.cxx +++ b/ucb/source/ucp/webdav-neon/webdavresultset.cxx @@ -72,7 +72,7 @@ void DynamicResultSet::initStatic() m_xResultSet1 = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new DataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new DataSupplier( m_xContext, m_xContent, m_aCommand.Mode ), m_xEnv ); @@ -84,7 +84,7 @@ void DynamicResultSet::initDynamic() m_xResultSet1 = new ::ucbhelper::ResultSet( m_xContext, m_aCommand.Properties, - new DataSupplier( uno::Reference<lang::XMultiServiceFactory>(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), + new DataSupplier( m_xContext, m_xContent, m_aCommand.Mode ), m_xEnv ); diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index d649c239c2b0..b6d092d756d3 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -1074,7 +1074,7 @@ rtl::OUString Content::getParentURL() // static uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Sequence< beans::Property >& rProperties, const ContentProperties& rData, const rtl::Reference< ::ucbhelper::ContentProviderImplHelper >& rProvider, @@ -1083,7 +1083,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Note: Empty sequence means "get values of all supported properties". rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( rSMgr ); + = new ::ucbhelper::PropertyValueSet( rxContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) @@ -1448,7 +1448,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } uno::Reference< sdbc::XRow > xResultRow - = getPropertyValues( xSMgr, + = getPropertyValues( comphelper::getComponentContext(xSMgr), rProperties, *xProps, xProvider, |