diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-23 17:23:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-08-27 15:40:08 +0200 |
commit | 206c70eef30f7b6f538b88f7fb9505f397bef073 (patch) | |
tree | d311561f2eb90b57aeed5c1642882a90ddbd4c6a /unotools | |
parent | 7634d064adc2c773288cec751674ff691de20b2b (diff) |
fdo#46808, Adapt TempFile UNO service to new style
Change-Id: Ia448d6d74201e2be487c6d8317f94be3745808aa
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 103adee9204d..037d16bbe811 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/ucb/UnsupportedDataSinkException.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp> #include <com/sun/star/io/XActiveDataStreamer.hpp> +#include <com/sun/star/io/TempFile.hpp> #include <com/sun/star/ucb/DocumentHeaderField.hpp> #include <com/sun/star/ucb/XCommandInfo.hpp> #include <com/sun/star/ucb/XCommandProcessor.hpp> @@ -1322,17 +1323,12 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInp m_xSeekable = Reference < XSeekable > ( rxInputStream, UNO_QUERY ); if( !m_xSeekable.is() && rxInputStream.is() ) { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - Reference< XOutputStream > rxTempOut = Reference < XOutputStream > ( - xFactory->createInstance ( ::rtl::OUString("com.sun.star.io.TempFile") ), - UNO_QUERY ); + Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + Reference< XOutputStream > rxTempOut = Reference < XOutputStream > ( TempFile::create(xContext), UNO_QUERY_THROW ); - if( rxTempOut.is() ) - { - ::comphelper::OStorageHelper::CopyInputToOutput( rxInputStream, rxTempOut ); - m_xInputStream = Reference< XInputStream >( rxTempOut, UNO_QUERY ); - m_xSeekable = Reference < XSeekable > ( rxTempOut, UNO_QUERY ); - } + ::comphelper::OStorageHelper::CopyInputToOutput( rxInputStream, rxTempOut ); + m_xInputStream = Reference< XInputStream >( rxTempOut, UNO_QUERY ); + m_xSeekable = Reference < XSeekable > ( rxTempOut, UNO_QUERY ); } } |