summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-10-28 11:45:47 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-28 12:00:06 +0100
commited2790435f74d6eaa28fcc758d2db9e1c77b5170 (patch)
tree24ad162948d2d6741db7fa0eaf9d4380f4bdcfa5 /sw/qa/extras/uiwriter/uiwriter.cxx
parent850871e04e247262242836180d8a5cf59b2f95ef (diff)
SwUiWriterTest: allow loading a custom bugdoc
Change-Id: I5578e462c21c023d8c9a269f2ca254e20c1a617e
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index f9e37f62578e..fa0bb144dbeb 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -28,12 +28,14 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- SwDoc* createEmptyDoc();
+ SwDoc* createDoc(const char* pName = 0);
};
-SwDoc* SwUiWriterTest::createEmptyDoc()
+SwDoc* SwUiWriterTest::createDoc(const char* pName)
{
- load(DATA_DIRECTORY, "empty.odt");
+ if (!pName)
+ pName = "empty.odt";
+ load(DATA_DIRECTORY, pName);
SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
return pTxtDoc->GetDocShell()->GetDoc();
@@ -53,7 +55,7 @@ static const OUString EXPECTED_REPLACE_CONTENT("toto toto tutu");
void SwUiWriterTest::testReplaceForward()
{
- SwDoc* pDoc = createEmptyDoc();
+ SwDoc* pDoc = createDoc();
sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
@@ -75,7 +77,7 @@ void SwUiWriterTest::testReplaceForward()
void SwUiWriterTest::testReplaceBackward()
{
- SwDoc* pDoc = createEmptyDoc();
+ SwDoc* pDoc = createDoc();
sw::UndoManager& rUndoManager = pDoc->GetUndoManager();