summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-11-05 20:26:25 +0100
committerLuboš Luňák <l.lunak@collabora.com>2014-11-06 16:55:17 +0100
commit3b72f55247a5d9b62490b66900d91f797674b50d (patch)
treec0fcbab03b432038a606986016494c5971304d71
parent0d349a49871301506c3a714c95bbe309bbd7eb1d (diff)
properly discard dumped layout on test document (re)loads
Change-Id: I8673810e8c04cd128a691ee1c1e8c4731108b605
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index dd6a481f0666..413d0162814c 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -362,6 +362,15 @@ private:
xmlFreeTextWriter(pXmlWriter);
}
+ void discardDumpedLayout()
+ {
+ if (mpXmlBuffer)
+ {
+ xmlBufferFree(mpXmlBuffer);
+ mpXmlBuffer = 0;
+ }
+ }
+
void calcLayout()
{
SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
@@ -610,6 +619,7 @@ protected:
std::cout << pName << ",";
mnStartTime = osl_getGlobalTimer();
mxComponent = loadFromDesktop(getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.text.TextDocument");
+ discardDumpedLayout();
if (mustCalcLayoutOf(pName))
calcLayout();
}
@@ -629,6 +639,7 @@ protected:
mxComponent = loadFromDesktop(mailMergeOutputURL + "/" + name, "com.sun.star.text.TextDocument");
CPPUNIT_ASSERT( mxComponent.is());
OString name2 = OUStringToOString( name, RTL_TEXTENCODING_UTF8 );
+ discardDumpedLayout();
if (mustCalcLayoutOf(name2.getStr()))
calcLayout();
}
@@ -659,12 +670,7 @@ protected:
validate(maTempFile.GetFileName(), test::ODF);
}
}
-
- if (mpXmlBuffer)
- {
- xmlBufferFree(mpXmlBuffer);
- mpXmlBuffer = 0;
- }
+ discardDumpedLayout();
if (mustCalcLayoutOf(filename))
calcLayout();
}
@@ -685,11 +691,7 @@ protected:
{
sal_uInt32 nEndTime = osl_getGlobalTimer();
std::cout << (nEndTime - mnStartTime) << std::endl;
- if (mpXmlBuffer)
- {
- xmlBufferFree(mpXmlBuffer);
- mpXmlBuffer = 0;
- }
+ discardDumpedLayout();
}
/// Get page count.