diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-11 14:18:18 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-11 16:26:05 +0100 |
commit | 4a6b56a5a1cd8756ff6d0335554fe78bf9988c27 (patch) | |
tree | dfc8d944064120d6a1736ec8efc2093517276064 /sw/qa/uibase/shells | |
parent | 69efabc0ce798b86b6971f5a9adca11e98bec4d1 (diff) |
SwModelTestBase: use createSwDoc everywhere
In order to unify the code
Also call getSwDoc only when it's needed so move it outside
createSwDoc
Change-Id: I082d46108581e8f2e2e430e854980035f471ceac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142586
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uibase/shells')
-rw-r--r-- | sw/qa/uibase/shells/shells.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx index 2f91ba4f8b38..55b388860adc 100644 --- a/sw/qa/uibase/shells/shells.cxx +++ b/sw/qa/uibase/shells/shells.cxx @@ -47,7 +47,8 @@ public: CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testTdf130179) { - SwDoc* pDoc = createSwDoc(); + createSwDoc(); + SwDoc* pDoc = getSwDoc(); IDocumentContentOperations& rIDCO = pDoc->getIDocumentContentOperations(); SwCursorShell* pShell(pDoc->GetEditShell()); SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>); @@ -78,7 +79,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testShapeTextAlignment) // FIXME find out why this fails on macOS/Windows #if !defined(MACOSX) && !defined(_WIN32) // Create a document with a rectangle in it. - SwDoc* pDoc = createSwDoc(); + createSwDoc(); + SwDoc* pDoc = getSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); Point aStartPos(1000, 1000); pWrtShell->BeginCreate(SdrObjKind::Rectangle, aStartPos); @@ -119,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOleSavePreviewUpdate) { // Load a document with 2 charts in it. The second is down enough that you have to scroll to // trigger its rendering. Previews are missing for both. - load("ole-save-preview-update.odt"); + createSwDoc("ole-save-preview-update.odt"); // Explicitly update OLE previews, etc. dispatchCommand(mxComponent, ".uno:UpdateAll", {}); @@ -140,7 +142,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOleSavePreviewUpdate) CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOlePreviewUpdate) { // Given a document with an embedded Writer object: - load("ole-preview-update.odt"); + createSwDoc("ole-preview-update.odt"); // When updating "all" (including OLE previews): dispatchCommand(mxComponent, ".uno:UpdateAll", {}); @@ -162,7 +164,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testOlePreviewUpdate) CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testBibliographyUrlContextMenu) { // Given a document with a bibliography field: - SwDoc* pDoc = createSwDoc(); + createSwDoc(); + SwDoc* pDoc = getSwDoc(); uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xField( xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY); @@ -199,7 +202,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testBibliographyUrlContextMenu) CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testBibliographyLocalCopyContextMenu) { // Given a document with a bibliography field's local copy: - SwDoc* pDoc = createSwDoc(); + createSwDoc(); + SwDoc* pDoc = getSwDoc(); uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xField( xFactory->createInstance("com.sun.star.text.TextField.Bibliography"), uno::UNO_QUERY); @@ -237,7 +241,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testBibliographyLocalCopyContextMenu) CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testContentControlPageBreak) { // Given a document with a content control and a cursor inside the content control: - SwDoc* pDoc = createSwDoc(); + createSwDoc(); + SwDoc* pDoc = getSwDoc(); uno::Reference<lang::XMultiServiceFactory> xMSF(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XText> xText = xTextDocument->getText(); |