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 /svl | |
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 'svl')
-rw-r--r-- | svl/source/fsstor/fsstorage.cxx | 18 | ||||
-rw-r--r-- | svl/source/misc/sharecontrolfile.cxx | 8 |
2 files changed, 12 insertions, 14 deletions
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index bfc6bdd41a92..147d6dad548f 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -32,7 +32,8 @@ #include <com/sun/star/ucb/NameClash.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/ucb/XContentAccess.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/ucb/InteractiveIOException.hpp> #include <com/sun/star/ucb/IOErrorCode.hpp> @@ -52,6 +53,7 @@ #include <comphelper/processfactory.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/storagehelper.hxx> #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -481,10 +483,9 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement( { if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) { - uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess( - m_pImpl->m_xFactory->createInstance( - ::rtl::OUString( "com.sun.star.ucb.SimpleFileAccess" ) ), - uno::UNO_QUERY_THROW ); + uno::Reference<ucb::XSimpleFileAccess2> xSimpleFileAccess( + ucb::SimpleFileAccess::create( + comphelper::ComponentContext(m_pImpl->m_xFactory).getUNOContext() ) ); xResult = xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ); } else @@ -1472,10 +1473,9 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl { if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) { - uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess( - m_pImpl->m_xFactory->createInstance( - ::rtl::OUString( "com.sun.star.ucb.SimpleFileAccess" ) ), - uno::UNO_QUERY_THROW ); + uno::Reference<ucb::XSimpleFileAccess2> xSimpleFileAccess( + ucb::SimpleFileAccess::create( + comphelper::ComponentContext(m_pImpl->m_xFactory).getUNOContext() ) ); uno::Reference< io::XStream > xStream = xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ); diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index 34d8b4a441b8..10e21f14a3ae 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -29,7 +29,8 @@ #include <stdio.h> -#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/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/ucb/InsertCommandArgument.hpp> @@ -360,10 +361,7 @@ void ShareControlFile::RemoveFile() Close(); - uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleFileAccess( - xFactory->createInstance( ::rtl::OUString("com.sun.star.ucb.SimpleFileAccess") ), - uno::UNO_QUERY_THROW ); + uno::Reference<ucb::XSimpleFileAccess2> xSimpleFileAccess(ucb::SimpleFileAccess::create(comphelper::getProcessComponentContext())); xSimpleFileAccess->kill( m_aURL ); } |