Kaydet (Commit) 98ddd7a3 authored tarafından Michael Stahl's avatar Michael Stahl

sw: fix SwUiWriterTest pointlessly loading an "empty.odt" ...

... instead of just creating a new document.

Change-Id: Ib336c07f6827775a9c1a4fa0b8fbfe4ae0ff8221
üst 9060439f
......@@ -571,15 +571,21 @@ 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();
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment