LCOV - code coverage report
Current view: top level - sc/qa/unit/helper - xpath.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 8 8 100.0 %
Date: 2014-11-03 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #include "xpath.hxx"
      11             : 
      12             : #include <cppunit/TestAssert.h>
      13             : #include "qahelper.hxx"
      14             : 
      15             : #include <unotools/tempfile.hxx>
      16             : #include <unotools/ucbstreamhelper.hxx>
      17             : 
      18             : #include <test/xmltesttools.hxx>
      19             : 
      20             : #include <com/sun/star/packages/zip/ZipFileAccess.hpp>
      21             : 
      22           2 : xmlDocPtr XPathHelper::parseExport(ScDocShell* pShell, uno::Reference<lang::XMultiServiceFactory> xSFactory, const OUString& rFile, sal_Int32 nFormat)
      23             : {
      24           2 :     boost::shared_ptr<utl::TempFile> pTempFile = ScBootstrapFixture::exportTo(pShell, nFormat);
      25             : 
      26             :     // Read the XML stream we're interested in.
      27           4 :     uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(xSFactory), pTempFile->GetURL());
      28           4 :     uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(rFile), uno::UNO_QUERY);
      29           2 :     CPPUNIT_ASSERT(xInputStream.is());
      30           4 :     boost::shared_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
      31             : 
      32           4 :     return XmlTestTools::parseXmlStream(pStream.get());
      33          42 : }
      34             : 
      35             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10