[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sfx2/source sw/qa

Miklos Vajna vmiklos at collabora.co.uk
Tue Jul 3 15:58:48 UTC 2018


 sfx2/source/doc/objstor.cxx        |    2 ++
 sw/qa/extras/uiwriter/uiwriter.cxx |    7 +++++++
 2 files changed, 9 insertions(+)

New commits:
commit 3d4e41009c42b26d318af20ac1e2da301212c1cf
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jul 3 09:07:49 2018 +0200

    tdf#117757 sfx2 save-as: fix leftover temporary files for embedded objects
    
    This is really similar to c1676204447df942e766c0780c1580e1f0427b73
    (tdf#117225 sfx2: fix leftover temp file when saving doc with embedded
    objects, 2018-05-14), just this is save as, not save.
    
    (cherry picked from commit b8fd1a814ffc80f2802c5b980febabcffe9606cb)
    
    Change-Id: If78d91262bfbe97846287deb0794e4101ef7b4af
    Reviewed-on: https://gerrit.libreoffice.org/56869
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 244de5869a34..7f34e6a9ca96 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1294,7 +1294,9 @@ bool SfxObjectShell::SaveTo_Impl
         rMedium.CloseAndRelease();
         if ( bStorageBasedTarget )
         {
+            rMedium.SetHasEmbeddedObjects(GetEmbeddedObjectContainer().HasEmbeddedObjects());
             rMedium.GetOutputStorage();
+            rMedium.SetHasEmbeddedObjects(false);
         }
     }
 
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index a02bb95e923e..619ba37ab9bb 100755
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -6300,6 +6300,13 @@ void SwUiWriterTest::testTdf117225()
     int nActual = CountFilesInDirectory(aTargetDirectory);
     // nActual was nExpected + 1, i.e. we leaked a tempfile.
     CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
+
+    OUString aTargetFileSaveAs = aTargetDirectory + "tdf117225-save-as.odt";
+    xStorable->storeAsURL(aTargetFileSaveAs, {});
+    ++nExpected;
+    nActual = CountFilesInDirectory(aTargetDirectory);
+    // nActual was nExpected + 1, i.e. we leaked a tempfile.
+    CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
 void SwUiWriterTest::testTdf91801()


More information about the Libreoffice-commits mailing list