summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-07-19 22:22:15 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-07-19 22:22:40 +0200
commit83da521ee211bbc7426b4f7f0a3acb033d9d7680 (patch)
tree547984f5190636692b50e582c02bd6916bf5894a
parente674cd3f77ed8cf3aebf8008236188316192ddd6 (diff)
one more simplification
Change-Id: I9aaf67872dde324f403598a7361cd4eda60b82b0
-rw-r--r--chart2/qa/extras/chart2export.cxx11
-rw-r--r--sc/qa/unit/helper/xpath.cxx16
2 files changed, 5 insertions, 22 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 3ce0486d5c30..44a3d66de660 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -161,17 +161,8 @@ xmlDocPtr Chart2ExportTest::parseExport(const OUString& rDir, const OUString& rF
uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(findChartFile(rDir, xNameAccess)), uno::UNO_QUERY);
CPPUNIT_ASSERT(xInputStream.is());
boost::shared_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
- sal_uInt64 const nSize = pStream->remainingSize();
- OStringBuffer aDocument(nSize);
- char ch;
- for (sal_Size i = 0; i < nSize; ++i)
- {
- pStream->ReadChar( ch );
- aDocument.append(ch);
- }
- // Parse the XML.
- return xmlParseMemory((const char*)aDocument.getStr(), aDocument.getLength());
+ return parseXmlStream(pStream.get());
}
void Chart2ExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
diff --git a/sc/qa/unit/helper/xpath.cxx b/sc/qa/unit/helper/xpath.cxx
index 59955ff17c91..c90b7c0b74b1 100644
--- a/sc/qa/unit/helper/xpath.cxx
+++ b/sc/qa/unit/helper/xpath.cxx
@@ -15,6 +15,8 @@
#include <unotools/tempfile.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <test/xmltesttools.hxx>
+
#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
xmlDocPtr XPathHelper::parseExport(ScDocShell* pShell, uno::Reference<lang::XMultiServiceFactory> xSFactory, const OUString& rFile, sal_Int32 nFormat)
@@ -26,18 +28,8 @@ xmlDocPtr XPathHelper::parseExport(ScDocShell* pShell, uno::Reference<lang::XMul
uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(rFile), uno::UNO_QUERY);
CPPUNIT_ASSERT(xInputStream.is());
boost::shared_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
- sal_uInt64 const nSize = pStream->remainingSize();
- OStringBuffer aDocument(nSize);
- char ch;
- for (sal_Size i = 0; i < nSize; ++i)
- {
- pStream->ReadChar( ch );
- aDocument.append(ch);
- }
- CPPUNIT_ASSERT(!aDocument.isEmpty());
-
- // Parse the XML.
- return xmlParseMemory((const char*)aDocument.getStr(), aDocument.getLength());
+
+ return XmlTestTools::parseXmlStream(pStream.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */