diff options
author | Andras Timar <andras.timar@collabora.com> | 2020-11-04 23:11:26 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-11-05 06:56:28 +0100 |
commit | 2897383dc831bca0db1ff040dc9f96a3611d262e (patch) | |
tree | 5ef8cda80f793d7fdb9d205b7b15ad5bdc969aa7 /desktop | |
parent | 12eac5bcbc9b71bf00cb88b918988826229cca35 (diff) |
use a utl::TempFile and clean it up after test
Change-Id: I1cbe7fd8002f6ba54532135de935805dd6a4e0e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105319
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 5d44a289af0f..74d9bcede0cf 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -2797,12 +2797,13 @@ void DesktopLOKTest::testCalcSaveAs() Scheduler::ProcessEventsToIdle(); // Save as a new file. - OUString aNewFileUrl = "file:///tmp/saveas.ods"; - pDocument->pClass->saveAs(pDocument, aNewFileUrl.toUtf8().getStr(), nullptr, nullptr); + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "ods", nullptr); closeDoc(); // Load the new document and verify that the in-flight changes are saved. - pDocument = loadDocUrl(aNewFileUrl, LOK_DOCTYPE_SPREADSHEET); + pDocument = loadDocUrl(aTempFile.GetURL(), LOK_DOCTYPE_SPREADSHEET); CPPUNIT_ASSERT(pDocument); ViewCallback aView(pDocument); |