diff options
author | Noel Grandin <noel@peralex.com> | 2012-05-29 17:17:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-06 10:01:22 +0200 |
commit | d08578912f2c9ef42d4349079422e25b951e544e (patch) | |
tree | d029b5a9110bcdc255e72ef9c98887f3f8521ea6 /desktop/source | |
parent | 7d2a5b5114987f1ab415e32ebb5bb9a46b98dc17 (diff) |
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new SimpleFileAccess::create method
Change-Id: Ie5b0696fe2228a9033b19969245a53c21a61aa14
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'desktop/source')
4 files changed, 15 insertions, 21 deletions
diff --git a/desktop/source/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx index 63ab7cb7cefe..18e648d3d103 100644 --- a/desktop/source/deployment/dp_log.cxx +++ b/desktop/source/deployment/dp_log.cxx @@ -37,7 +37,8 @@ #include "comphelper/unwrapargs.hxx" #include "com/sun/star/deployment/DeploymentException.hpp" #include "com/sun/star/ucb/XProgressHandler.hpp" -#include "com/sun/star/ucb/XSimpleFileAccess.hpp" +#include "com/sun/star/ucb/SimpleFileAccess.hpp" +#include "com/sun/star/ucb/XSimpleFileAccess2.hpp" #include "com/sun/star/io/XSeekable.hpp" #include <stdio.h> @@ -103,10 +104,7 @@ ProgressLogImpl::ProgressLogImpl( boost::optional< Reference<task::XInteractionHandler> > interactionHandler; comphelper::unwrapArgs( args, log_file, interactionHandler ); - Reference<ucb::XSimpleFileAccess> xSimpleFileAccess( - xContext->getServiceManager()->createInstanceWithContext( - OUSTR("com.sun.star.ucb.SimpleFileAccess"), - xContext ), UNO_QUERY_THROW ); + Reference<ucb::XSimpleFileAccess2> xSimpleFileAccess( ucb::SimpleFileAccess::create(xContext) ); // optional ia handler: if (interactionHandler) xSimpleFileAccess->setInteractionHandler( *interactionHandler ); diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index e7add39b3d13..ba3b785b3673 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -45,7 +45,8 @@ #include <l10ntools/compilehelp.hxx> #include <l10ntools/HelpIndexer.hxx> #endif -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarExpandUrl.hpp> @@ -115,8 +116,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend void revokeEntryFromDb(OUString const & url); bool activateEntry(OUString const & url); - Reference< ucb::XSimpleFileAccess > getFileAccess( void ); - Reference< ucb::XSimpleFileAccess > m_xSFA; + Reference< ucb::XSimpleFileAccess2 > getFileAccess( void ); + Reference< ucb::XSimpleFileAccess2 > m_xSFA; const Reference<deployment::XPackageTypeInfo> m_xHelpTypeInfo; Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos; @@ -402,7 +403,7 @@ void BackendImpl::implProcessHelp( const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); data.dataUrl = sHelpFolder; - Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); + Reference< ucb::XSimpleFileAccess2 > xSFA = getFileAccess(); rtl::OUString aHelpURL = xPackage->getURL(); rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL ); rtl::OUString aName = xPackage->getName(); @@ -585,7 +586,7 @@ void BackendImpl::implProcessHelp( void BackendImpl::implCollectXhpFiles( const rtl::OUString& aDir, std::vector< rtl::OUString >& o_rXhpFileVector ) { - Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); + Reference< ucb::XSimpleFileAccess2 > xSFA = getFileAccess(); // Scan xhp files recursively Sequence< rtl::OUString > aSeq = xSFA->getFolderContents( aDir, true ); @@ -611,17 +612,14 @@ void BackendImpl::implCollectXhpFiles( const rtl::OUString& aDir, } } -Reference< ucb::XSimpleFileAccess > BackendImpl::getFileAccess( void ) +Reference< ucb::XSimpleFileAccess2 > BackendImpl::getFileAccess( void ) { if( !m_xSFA.is() ) { Reference<XComponentContext> const & xContext = getComponentContext(); if( xContext.is() ) { - m_xSFA = Reference< ucb::XSimpleFileAccess >( - xContext->getServiceManager()->createInstanceWithContext( - rtl::OUString("com.sun.star.ucb.SimpleFileAccess" ), - xContext ), UNO_QUERY ); + m_xSFA = ucb::SimpleFileAccess::create(xContext); } if( !m_xSFA.is() ) { diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index 12f4ec49aab3..726f6a5c85cc 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -219,10 +219,7 @@ bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescript if ( !m_xSimpleFileAccess.is() ) { - m_xSimpleFileAccess = uno::Reference< ucb::XSimpleFileAccess >( - m_ctx->getServiceManager()->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), - m_ctx ), uno::UNO_QUERY ); + m_xSimpleFileAccess = ucb::SimpleFileAccess::create(m_ctx); } ::rtl::OUString aExtIdentifier; diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx index adadb3b293e6..d16a15b88376 100644 --- a/desktop/source/migration/services/oo3extensionmigration.hxx +++ b/desktop/source/migration/services/oo3extensionmigration.hxx @@ -34,7 +34,8 @@ #include <com/sun/star/task/XJob.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/dom/XDocumentBuilder.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <com/sun/star/deployment/XExtensionManager.hpp> #include <osl/mutex.hxx> @@ -80,7 +81,7 @@ namespace migration private: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_ctx; ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XDocumentBuilder > m_xDocBuilder; - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > m_xSimpleFileAccess; + ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > m_xSimpleFileAccess; ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager; ::osl::Mutex m_aMutex; ::rtl::OUString m_sSourceDir; |