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 /comphelper | |
parent | 7634d064adc2c773288cec751674ff691de20b2b (diff) |
fdo#46808, Adapt TempFile UNO service to new style
Change-Id: Ia448d6d74201e2be487c6d8317f94be3745808aa
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/streaming/seekableinput.cxx | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/comphelper/source/streaming/seekableinput.cxx b/comphelper/source/streaming/seekableinput.cxx index c18d66afe26d..41ee54e70017 100644 --- a/comphelper/source/streaming/seekableinput.cxx +++ b/comphelper/source/streaming/seekableinput.cxx @@ -17,9 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <com/sun/star/io/TempFile.hpp> #include <com/sun/star/io/XOutputStream.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/seekableinput.hxx> using namespace ::com::sun::star; @@ -91,22 +93,19 @@ void OSeekableInputWrapper::PrepareCopy_Impl() throw uno::RuntimeException(); uno::Reference< io::XOutputStream > xTempOut( - m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), - uno::UNO_QUERY ); + io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()), + uno::UNO_QUERY_THROW ); - if ( xTempOut.is() ) + copyInputToOutput_Impl( m_xOriginalStream, xTempOut ); + xTempOut->closeOutput(); + + uno::Reference< io::XSeekable > xTempSeek( xTempOut, uno::UNO_QUERY ); + if ( xTempSeek.is() ) { - copyInputToOutput_Impl( m_xOriginalStream, xTempOut ); - xTempOut->closeOutput(); - - uno::Reference< io::XSeekable > xTempSeek( xTempOut, uno::UNO_QUERY ); - if ( xTempSeek.is() ) - { - xTempSeek->seek( 0 ); - m_xCopyInput = uno::Reference< io::XInputStream >( xTempOut, uno::UNO_QUERY ); - if ( m_xCopyInput.is() ) - m_xCopySeek = xTempSeek; - } + xTempSeek->seek( 0 ); + m_xCopyInput = uno::Reference< io::XInputStream >( xTempOut, uno::UNO_QUERY ); + if ( m_xCopyInput.is() ) + m_xCopySeek = xTempSeek; } } |