summaryrefslogtreecommitdiff
path: root/comphelper/source/streaming/seekableinput.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper/source/streaming/seekableinput.cxx')
-rw-r--r--comphelper/source/streaming/seekableinput.cxx27
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;
}
}