diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-18 13:42:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-19 07:52:03 +0200 |
commit | c6c1445fe8d16fe98f809c31612c2bdddde946da (patch) | |
tree | 85df1e9f6f4fae7b28a2f71fedfe055147804679 /filter | |
parent | d99bfa6e6829c708b62c804c0754ee90c976ce6a (diff) |
simplify usage of TempFile in XMLFilterJarHelper
TempFile already handles the stream. And not touching the URL
means we stay on the fast path for temp files.
Change-Id: Ied68dd4c22e77c2a4e2c81f965413a55fb1e563d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140115
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/xsltdialog/xmlfilterjar.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx index 3858da641419..ac78fb8c3d75 100644 --- a/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/filter/source/xsltdialog/xmlfilterjar.cxx @@ -193,18 +193,17 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const std::ve // create TypeDetection.xcu utl::TempFile aTempFile; aTempFile.EnableKillingFile(); - OUString aTempFileURL( aTempFile.GetURL() ); + SvStream* pStream = aTempFile.GetStream(StreamMode::READWRITE); { - osl::File aOutputFile( aTempFileURL ); - (void)aOutputFile.open(osl_File_OpenFlag_Write); - Reference< XOutputStream > xOS( new OSLOutputStreamWrapper( aOutputFile ) ); + Reference< XOutputStream > xOS( new ::utl::OOutputStreamWrapper( *pStream ) ); TypeDetectionExporter aExporter( mxContext ); aExporter.doExport(xOS,rFilters); } - Reference< XInputStream > XIS( new utl::OSeekableInputStreamWrapper( new SvFileStream(aTempFileURL, StreamMode::READ ), true ) ); + pStream->Seek(0); + Reference< XInputStream > XIS( new utl::OSeekableInputStreamWrapper( *pStream ) ); addFile_( xRootFolder, xFactory, XIS, "TypeDetection.xcu" ); Reference< XChangesBatch > xBatch( xIfc, UNO_QUERY ); |