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 /oox/source/dump/dumperbase.cxx | |
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 'oox/source/dump/dumperbase.cxx')
-rw-r--r-- | oox/source/dump/dumperbase.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 5ad2f6a4c9b1..3eaf7ad5adb4 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -32,7 +32,8 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XTextOutputStream.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> #include <comphelper/docpasswordhelper.hxx> #include <osl/file.hxx> #include <rtl/math.hxx> @@ -118,8 +119,7 @@ Reference< XInputStream > InputOutputHelper::openInputStream( Reference< XInputStream > xInStrm; if( rxContext.is() ) try { - Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ); - Reference< XSimpleFileAccess > xFileAccess( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); + Reference<XSimpleFileAccess2> xFileAccess(SimpleFileAccess::create(rxContext)); xInStrm = xFileAccess->openFileRead( rFileName ); } catch( Exception& ) @@ -136,8 +136,7 @@ Reference< XOutputStream > InputOutputHelper::openOutputStream( Reference< XOutputStream > xOutStrm; if( rxContext.is() ) try { - Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ); - Reference< XSimpleFileAccess > xFileAccess( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); + Reference<XSimpleFileAccess2> xFileAccess(SimpleFileAccess::create(rxContext)); xOutStrm = xFileAccess->openFileWrite( rFileName ); } catch( Exception& ) @@ -1898,8 +1897,7 @@ void StorageObjectBase::implDump() if( bIsRoot ) try { aSysOutPath += OOX_DUMP_DUMPEXT; - Reference< XMultiServiceFactory > xFactory( getContext()->getServiceManager(), UNO_QUERY_THROW ); - Reference< XSimpleFileAccess > xFileAccess( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); + Reference<XSimpleFileAccess2> xFileAccess(SimpleFileAccess::create(getContext())); xFileAccess->kill( aSysOutPath ); } catch( Exception& ) |