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/source/ucp/ext | |
parent | 2cf0f6ea36e1525193544258eef2828a54345510 (diff) |
fdo#46808, remove some more XMultiServiceFactory fields
Change-Id: I8d039a933c9fde1a24b35954bb5a1f151e9aa160
Diffstat (limited to 'ucb/source/ucp/ext')
-rw-r--r-- | ucb/source/ucp/ext/ucpext_content.cxx | 29 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_content.hxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_datasupplier.cxx | 22 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_datasupplier.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_provider.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/ext/ucpext_resultset.cxx | 2 |
6 files changed, 30 insertions, 31 deletions
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 ) ); |