summaryrefslogtreecommitdiff
path: root/sw/qa/extras/inc/swmodeltestbase.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/inc/swmodeltestbase.hxx')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 27cacf254a1c..79eb8af578ed 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -139,8 +139,10 @@ protected:
void executeImportExportImportTest(const char* filename)
{
header();
+ preTest(filename);
load(mpTestDocumentPath, filename);
- reload(mpFilter);
+ reload(mpFilter, filename);
+ postTest(filename);
verify();
finish();
}
@@ -174,6 +176,14 @@ protected:
{
}
+ /**
+ * Override this function if not calcing layout is needed
+ */
+ virtual bool mustCalcLayoutOf(const char* /*filename*/)
+ {
+ return true;
+ }
+
private:
void dumpLayout()
{
@@ -391,7 +401,7 @@ protected:
std::cerr << "File tested,Execution Time (ms)" << std::endl;
}
- void load(const char* pDir, const char* pName, bool bCalcLayout = true)
+ void load(const char* pDir, const char* pName)
{
if (mxComponent.is())
mxComponent->dispose();
@@ -399,11 +409,11 @@ protected:
std::cerr << pName << ",";
m_nStartTime = osl_getGlobalTimer();
mxComponent = loadFromDesktop(getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.text.TextDocument");
- if (bCalcLayout)
+ if (mustCalcLayoutOf(pName))
calcLayout();
}
- void reload(const char* pFilter)
+ void reload(const char* pFilter, const char* filename)
{
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aArgs(1);
@@ -420,7 +430,8 @@ protected:
xmlBufferFree(mpXmlBuffer);
mpXmlBuffer = 0;
}
- calcLayout();
+ if (mustCalcLayoutOf(filename))
+ calcLayout();
}
/// Save the loaded document to a tempfile. Can be used to check the resulting docx/odt directly as a ZIP file.