filter/source/msfilter/svdfppt.cxx |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit d99bfa6e6829c708b62c804c0754ee90c976ce6a
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Sep 18 13:55:08 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Sep 19 07:51:21 2022 +0200

    improve usage of TempFile in SdrPowerPointImport
    
    TempFile already handles the stream. And not touching the URL
    means we stay on the fast path for temp files.
    
    Change-Id: I05c70c422275032deeadc9f2f62024eebad8fb02
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140117
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index 4511789b0586..a3d82924af6a 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1849,18 +1849,14 @@ rtl::Reference<SdrObject> 
SdrPowerPointImport::ImportOLE( sal_uInt32 nOLEId,
             ::utl::TempFile aTmpFile;
             aTmpFile.EnableKillingFile();
 
-            if ( aTmpFile.IsValid() )
+            SvStream* pDest = aTmpFile.GetStream(StreamMode::READWRITE);
+            if (pDest)
             {
-                SvStream* pDest = aTmpFile.GetStream(StreamMode::TRUNC | 
StreamMode::WRITE);
-                if (pDest)
-                {
-                    bSuccess = SdrPowerPointOLEDecompress( *pDest, rStCtrl, 
nLen );
-                }
-                aTmpFile.CloseStream();
+                bSuccess = SdrPowerPointOLEDecompress( *pDest, rStCtrl, nLen );
             }
             if ( bSuccess )
             {
-                SvStream* pDest = aTmpFile.GetStream(StreamMode::READ);
+                pDest->Seek(0);
                 Storage* pObjStor = pDest ? new Storage( *pDest, true ) : 
nullptr;
                 if (pObjStor)
                 {

Reply via email to