diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-23 11:51:57 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-23 14:43:56 +0100 |
commit | 6c3cebd5aaec641807f5efed814fc5d1c64df149 (patch) | |
tree | dc5333838c1a973afc5b72190e0be28dfcdc6e76 /sw/qa/uibase | |
parent | 139d1aa610d19ab200deff1e3cd2c787f5c87d89 (diff) |
UnoApiTest: factor out createTempFile
Change-Id: I8d7bb4593839d3660b6609d836b09d50b68f5712
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143141
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uibase')
-rw-r--r-- | sw/qa/uibase/uiview/uiview.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index 348574b13f85..10b5eaa6eeee 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -42,12 +42,7 @@ public: CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements) { // Make a temporary copy of the test document - utl::TempFileNamed tmp; - tmp.EnableKillingFile(); - OUString sTempCopy = tmp.GetURL(); - CPPUNIT_ASSERT_EQUAL( - osl::FileBase::E_None, - osl::File::copy(createFileURL(u"updateall-objectreplacements.odt"), sTempCopy)); + createTempCopy(u"updateall-objectreplacements.odt"); /* BASIC code that exhibits the problem: @@ -71,7 +66,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements) = xFactory->createInstance("com.sun.star.frame.Desktop"); uno::Reference<frame::XComponentLoader> xComponentLoader(xInterface, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aLoadArgs{ comphelper::makePropertyValue("Hidden", true) }; - mxComponent = xComponentLoader->loadComponentFromURL(sTempCopy, "_default", 0, aLoadArgs); + mxComponent + = xComponentLoader->loadComponentFromURL(maTempFile.GetURL(), "_default", 0, aLoadArgs); // Perform the .uno:UpdateAll call and save xInterface = xFactory->createInstance("com.sun.star.frame.DispatchHelper"); @@ -87,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements) // Check the contents of the updated copy and verify that ObjectReplacements are there uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(xFactory), - sTempCopy); + maTempFile.GetURL()); CPPUNIT_ASSERT(xNameAccess->hasByName("ObjectReplacements/Components")); CPPUNIT_ASSERT(xNameAccess->hasByName("ObjectReplacements/Components_1")); |