filter/source/xsltdialog/xmlfilterjar.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit c6c1445fe8d16fe98f809c31612c2bdddde946da
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Sep 18 13:42:07 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Sep 19 07:52:03 2022 +0200

    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.gran...@collabora.co.uk>

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 );

Reply via email to