sw/qa/extras/uiwriter/uiwriter8.cxx |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 02b3a672cf954f7e001e309aa2f182da58c503c6
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Feb 21 15:37:42 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 21 17:41:47 2023 +0000

    sw: simplify test a bit
    
    Change-Id: Ib565e304b1067a8bca04efa323bb8d1789b1cd0e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147406
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 43d21e1bfb24..415f9b76c691 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2446,18 +2446,15 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf136740)
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106)
 {
     createSwDoc("cross_reference_demo_bmk.odt");
-    SwWrtShell* pWrtShell = getSwDoc()->GetDocShell()->GetWrtShell();
-
-    utl::TempFileNamed tempDir(nullptr, true);
 
-    const auto aPropertyValues = comphelper::InitPropertySequence(
-        { { "FileName", css::uno::Any(tempDir.GetURL() + "/test.odm") } });
+    const auto aPropertyValues
+        = comphelper::InitPropertySequence({ { "FileName", 
css::uno::Any(maTempFile.GetURL()) } });
     dispatchCommand(mxComponent, ".uno:NewGlobalDoc", aPropertyValues);
+    Scheduler::ProcessEventsToIdle();
 
-    // new document now!
-    mxComponent.set(pWrtShell->GetDoc()->GetDocShell()->GetModel());
-    CPPUNIT_ASSERT(mxComponent.is());
+    mxComponent = loadFromDesktop(maTempFile.GetURL());
 
+    SwWrtShell* pWrtShell = getSwDoc()->GetDocShell()->GetWrtShell();
     SwDoc* const pMasterDoc(pWrtShell->GetDoc());
     CPPUNIT_ASSERT_EQUAL(
         size_t(2),
@@ -2510,8 +2507,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106)
         static_cast<SwGetRefField 
const*>(fields[5]->GetField())->IsRefToHeadingCrossRefBookmark());
     CPPUNIT_ASSERT_EQUAL(OUString("Chapter 2"),
                          static_cast<SwGetRefField 
const*>(fields[5]->GetField())->GetPar2());
-
-    tempDir.EnableKillingFile();
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf103612)

Reply via email to