diff options
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 11 | ||||
-rw-r--r-- | sc/qa/unit/helper/xpath.cxx | 16 |
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: */ |