diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-02 17:46:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-15 08:28:44 +0100 |
commit | 5837402fb1daa437d9a1a37edc9ede57319944f1 (patch) | |
tree | 61e39515cd546fe7ad76364ebb444850b93541ce /package/source | |
parent | 3f15a663b273e4a437fd68335d6eab2b11fc80c9 (diff) |
fdo#46808, use service constructor for ucb::SimpleFileAccess
I upgraded the service to return XSimpleFileAccess3, since it
already implemented that interface, and it's backwards
compatible.
Change-Id: I40001a46048bd21a23b6a2f58a95376f06fc634b
Diffstat (limited to 'package/source')
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 11 | ||||
-rw-r--r-- | package/source/xstor/selfterminatefilestream.hxx | 4 | ||||
-rw-r--r-- | package/source/xstor/xfactory.cxx | 3 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 3 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 3 |
5 files changed, 10 insertions, 14 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 3e2017f2d426..4da325384247 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -19,7 +19,6 @@ #include <com/sun/star/uno/XComponentContext.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/lang/DisposedException.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -215,7 +214,7 @@ sal_Bool KillFile( const ::rtl::OUString& aURL, const uno::Reference< uno::XComp try { - uno::Reference < ucb::XSimpleFileAccess2 > xAccess( ucb::SimpleFileAccess::create( xContext ) ); + uno::Reference < ucb::XSimpleFileAccess3 > xAccess( ucb::SimpleFileAccess::create( xContext ) ); xAccess->kill( aURL ); bRet = sal_True; @@ -555,7 +554,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor try { if ( !aTempURL.isEmpty() && xStream.is() ) { - uno::Reference < ucb::XSimpleFileAccess2 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); + uno::Reference < ucb::XSimpleFileAccess3 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); uno::Reference< io::XOutputStream > xTempOutStream = xTempAccess->openFileWrite( aTempURL ); if ( xTempOutStream.is() ) @@ -639,7 +638,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor try { if ( !m_aTempURL.isEmpty() ) { - uno::Reference < ucb::XSimpleFileAccess2 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); + uno::Reference < ucb::XSimpleFileAccess3 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); uno::Reference< io::XOutputStream > xTempOutStream = xTempAccess->openFileWrite( m_aTempURL ); if ( xTempOutStream.is() ) @@ -688,7 +687,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetTempFileAsStream() if ( !m_aTempURL.isEmpty() ) { // the temporary file is not used if the cache is used - uno::Reference < ucb::XSimpleFileAccess2 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); + uno::Reference < ucb::XSimpleFileAccess3 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); try { @@ -727,7 +726,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetTempFileAsInputStream() if ( !m_aTempURL.isEmpty() ) { // the temporary file is not used if the cache is used - uno::Reference < ucb::XSimpleFileAccess2 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); + uno::Reference < ucb::XSimpleFileAccess3 > xTempAccess( ucb::SimpleFileAccess::create( ::comphelper::getProcessComponentContext() ) ); try { diff --git a/package/source/xstor/selfterminatefilestream.hxx b/package/source/xstor/selfterminatefilestream.hxx index 8698c3761059..85da3585b00f 100644 --- a/package/source/xstor/selfterminatefilestream.hxx +++ b/package/source/xstor/selfterminatefilestream.hxx @@ -22,7 +22,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess3.hpp> #include <cppuhelper/implbase2.hxx> struct OWriteStream_Impl; @@ -31,7 +31,7 @@ class OSelfTerminateFileStream : public cppu::WeakImplHelper2< ::com::sun::star: ::com::sun::star::io::XSeekable > { protected: - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > m_xFileAccess; + ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > m_xFileAccess; ::rtl::OUString m_aURL; diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index adb6207cd02d..c34155d031aa 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -18,7 +18,6 @@ */ #include <com/sun/star/ucb/SimpleFileAccess.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -153,7 +152,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr throw lang::IllegalArgumentException(); // TODO: } - uno::Reference < ucb::XSimpleFileAccess2 > xTempAccess( + uno::Reference < ucb::XSimpleFileAccess3 > xTempAccess( ucb::SimpleFileAccess::create( comphelper::getComponentContext(m_xFactory) ) ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 478df445d8a9..a42e68074242 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/io/TempFile.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XNamed.hpp> @@ -5943,7 +5942,7 @@ void SAL_CALL OStorage::attachToURL( const ::rtl::OUString& sURL, if ( !m_pImpl->m_pSwitchStream ) throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() ); - uno::Reference < ucb::XSimpleFileAccess2 > xAccess( + uno::Reference < ucb::XSimpleFileAccess3 > xAccess( ucb::SimpleFileAccess::create( comphelper::getComponentContext(m_pImpl->m_xFactory) ) ); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index f24774755a9e..89b3f2f4e8dc 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -50,7 +50,6 @@ #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/ucb/UniversalContentBroker.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <com/sun/star/io/XActiveDataStreamer.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/UseBackupException.hpp> @@ -1440,7 +1439,7 @@ void SAL_CALL ZipPackage::commitChanges() if( isLocalFile() ) { // write directly in case of local file - uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > xSimpleAccess( + uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > xSimpleAccess( SimpleFileAccess::create( comphelper::getComponentContext(m_xFactory) ) ); OSL_ENSURE( xSimpleAccess.is(), "Can't instatiate SimpleFileAccess service!\n" ); uno::Reference< io::XTruncate > xOrigTruncate; |