diff options
Diffstat (limited to 'sw/qa/inc/swmodeltestbase.hxx')
-rw-r--r-- | sw/qa/inc/swmodeltestbase.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 8265801f36f8..a0170896ac80 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -1030,6 +1030,18 @@ protected: // reqif-xhtml xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("reqif-xhtml"), BAD_CAST("http://www.w3.org/1999/xhtml")); } + + SwDoc* createSwDoc(const OUString& rDataDirectory = OUString(), const char* pName = nullptr) + { + if (rDataDirectory.isEmpty() || !pName) + loadURL("private:factory/swriter", nullptr); + else + load(rDataDirectory, pName); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + return pTextDoc->GetDocShell()->GetDoc(); + } }; /** |