summaryrefslogtreecommitdiff
path: root/desktop/source/deployment
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-29 17:17:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-06-06 10:01:22 +0200
commitd08578912f2c9ef42d4349079422e25b951e544e (patch)
treed029b5a9110bcdc255e72ef9c98887f3f8521ea6 /desktop/source/deployment
parent7d2a5b5114987f1ab415e32ebb5bb9a46b98dc17 (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/deployment')
-rw-r--r--desktop/source/deployment/dp_log.cxx8
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx18
2 files changed, 11 insertions, 15 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() )
{