LCOV - code coverage report
Current view: top level - writerperfect/source/draw - CDRImportFilter.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 16 23 69.6 %
Date: 2014-11-03 Functions: 5 8 62.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /* CDRImportFilter: Sets up the filter, and calls OdgExporter
       3             :  * to do the actual filtering
       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             : /* "This product is not manufactured, approved, or supported by
      11             :  * Corel Corporation or Corel Corporation Limited."
      12             :  */
      13             : 
      14             : #include <com/sun/star/uno/Reference.h>
      15             : #include <com/sun/star/uno/XComponentContext.hpp>
      16             : #include <cppuhelper/supportsservice.hxx>
      17             : 
      18             : #include <libcdr/libcdr.h>
      19             : #include <libodfgen/libodfgen.hxx>
      20             : 
      21             : #include "CDRImportFilter.hxx"
      22             : 
      23             : using com::sun::star::uno::Reference;
      24             : using com::sun::star::uno::Exception;
      25             : using com::sun::star::uno::RuntimeException;
      26             : using com::sun::star::uno::Sequence;
      27             : using com::sun::star::uno::XComponentContext;
      28             : using com::sun::star::uno::XInterface;
      29             : 
      30           2 : bool CDRImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
      31             : {
      32           2 :     return libcdr::CDRDocument::parse(&rInput, &rGenerator);
      33             : }
      34             : 
      35           2 : bool CDRImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName)
      36             : {
      37           2 :     if (libcdr::CDRDocument::isSupported(&rInput))
      38             :     {
      39           2 :         rTypeName = "draw_CorelDraw_Document";
      40           2 :         return true;
      41             :     }
      42             : 
      43           0 :     return false;
      44             : }
      45             : 
      46          14 : OUString CDRImportFilter_getImplementationName()
      47             : throw (RuntimeException)
      48             : {
      49          14 :     return OUString("com.sun.star.comp.Draw.CDRImportFilter");
      50             : }
      51             : 
      52           2 : Sequence< OUString > SAL_CALL CDRImportFilter_getSupportedServiceNames()
      53             : throw (RuntimeException)
      54             : {
      55           2 :     Sequence < OUString > aRet(2);
      56           2 :     OUString *pArray = aRet.getArray();
      57           2 :     pArray[0] =  "com.sun.star.document.ImportFilter";
      58           2 :     pArray[1] =  "com.sun.star.document.ExtendedTypeDetection";
      59           2 :     return aRet;
      60             : }
      61             : 
      62           2 : Reference< XInterface > SAL_CALL CDRImportFilter_createInstance(const Reference< XComponentContext > &rContext)
      63             : throw(Exception)
      64             : {
      65           2 :     return (cppu::OWeakObject *) new CDRImportFilter(rContext);
      66             : }
      67             : 
      68             : // XServiceInfo
      69           0 : OUString SAL_CALL CDRImportFilter::getImplementationName()
      70             : throw (RuntimeException, std::exception)
      71             : {
      72           0 :     return CDRImportFilter_getImplementationName();
      73             : }
      74           0 : sal_Bool SAL_CALL CDRImportFilter::supportsService(const OUString &rServiceName)
      75             : throw (RuntimeException, std::exception)
      76             : {
      77           0 :     return cppu::supportsService(this, rServiceName);
      78             : }
      79           0 : Sequence< OUString > SAL_CALL CDRImportFilter::getSupportedServiceNames()
      80             : throw (RuntimeException, std::exception)
      81             : {
      82           0 :     return CDRImportFilter_getSupportedServiceNames();
      83             : }
      84             : 
      85             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10