summaryrefslogtreecommitdiff
path: root/sw/qa/extras/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 4f71ff6b8e1e..cc18a772972e 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -392,6 +392,15 @@ protected:
return xAutoStyleFamily;
}
+ /// Similar to parseExport(), but this gives the xmlDocPtr of the layout dump.
+ xmlDocPtr parseLayoutDump()
+ {
+ if (!mpXmlBuffer)
+ dumpLayout();
+
+ return xmlParseMemory((const char*)xmlBufferContent(mpXmlBuffer), xmlBufferLength(mpXmlBuffer));;
+ }
+
/**
* Extract a value from the layout dump using an XPath expression and an attribute name.
*
@@ -399,10 +408,7 @@ protected:
*/
OUString parseDump(const OString& aXPath, const OString& aAttribute = OString())
{
- if (!mpXmlBuffer)
- dumpLayout();
-
- xmlDocPtr pXmlDoc = xmlParseMemory((const char*)xmlBufferContent(mpXmlBuffer), xmlBufferLength(mpXmlBuffer));;
+ xmlDocPtr pXmlDoc = parseLayoutDump();
xmlXPathContextPtr pXmlXpathCtx = xmlXPathNewContext(pXmlDoc);
xmlXPathObjectPtr pXmlXpathObj = xmlXPathEvalExpression(BAD_CAST(aXPath.getStr()), pXmlXpathCtx);