summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-06-30 22:43:22 +0200
committerMichael Stahl <mstahl@redhat.com>2015-06-30 23:24:57 +0200
commit98ddd7a32fd0d5fa080fac368b9dc53a06659285 (patch)
treeaf14d23ef21d4d6bfaf185e4dda4b0b57b6a3146 /sw
parent9060439f98e771d5079fb4434e2152bee053c40d (diff)
sw: fix SwUiWriterTest pointlessly loading an "empty.odt" ...
... instead of just creating a new document. Change-Id: Ib336c07f6827775a9c1a4fa0b8fbfe4ae0ff8221
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx12
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx5
2 files changed, 12 insertions, 5 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index e26b6e3553af..adf21ba7177b 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -572,14 +572,20 @@ protected:
void load(const char* pDir, const char* pName)
{
+ return loadURL(getURLFromSrc(pDir) + OUString::createFromAscii(pName), pName);
+ }
+
+ void loadURL(OUString const& rURL, const char* pName)
+ {
if (mxComponent.is())
mxComponent->dispose();
// Output name early, so in the case of a hang, the name of the hanging input file is visible.
- std::cout << pName << ",";
+ if (pName)
+ std::cout << pName << ",";
mnStartTime = osl_getGlobalTimer();
- mxComponent = loadFromDesktop(getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.text.TextDocument");
+ mxComponent = loadFromDesktop(rURL, "com.sun.star.text.TextDocument");
discardDumpedLayout();
- if (mustCalcLayoutOf(pName))
+ if (pName && mustCalcLayoutOf(pName))
calcLayout();
}
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 889eee5ec22d..c65fe6175c82 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -169,8 +169,9 @@ private:
SwDoc* SwUiWriterTest::createDoc(const char* pName)
{
if (!pName)
- pName = "empty.odt";
- load(DATA_DIRECTORY, pName);
+ loadURL("private:factory/swriter", nullptr);
+ else
+ load(DATA_DIRECTORY, pName);
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);