diff options
Diffstat (limited to 'oox')
-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& ) |