LCOV - code coverage report
Current view: top level - writerperfect/source/draw - FreehandImportFilter.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 17 23 73.9 %
Date: 2015-06-13 12:38:46 Functions: 6 8 75.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             : /* FreehandImportFilter: 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             : #include <com/sun/star/uno/Reference.h>
      11             : #include <com/sun/star/uno/XComponentContext.hpp>
      12             : #include <cppuhelper/supportsservice.hxx>
      13             : 
      14             : #include <libfreehand/libfreehand.h>
      15             : #include <libodfgen/libodfgen.hxx>
      16             : 
      17             : #include "FreehandImportFilter.hxx"
      18             : 
      19             : using com::sun::star::uno::Reference;
      20             : using com::sun::star::uno::Exception;
      21             : using com::sun::star::uno::RuntimeException;
      22             : using com::sun::star::uno::Sequence;
      23             : using com::sun::star::uno::XComponentContext;
      24             : using com::sun::star::uno::XInterface;
      25             : 
      26           0 : bool FreehandImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdgGenerator &rGenerator, utl::MediaDescriptor &)
      27             : {
      28           0 :     return libfreehand::FreeHandDocument::parse(&rInput, &rGenerator);
      29             : }
      30             : 
      31          87 : bool FreehandImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName)
      32             : {
      33          87 :     if (libfreehand::FreeHandDocument::isSupported(&rInput))
      34             :     {
      35           0 :         rTypeName = "draw_Freehand_Document";
      36           0 :         return true;
      37             :     }
      38             : 
      39          87 :     return false;
      40             : }
      41             : 
      42          38 : OUString FreehandImportFilter_getImplementationName()
      43             : throw (RuntimeException)
      44             : {
      45          38 :     return OUString("com.sun.star.comp.Draw.FreehandImportFilter");
      46             : }
      47             : 
      48           7 : Sequence< OUString > SAL_CALL FreehandImportFilter_getSupportedServiceNames()
      49             : throw (RuntimeException)
      50             : {
      51           7 :     Sequence < OUString > aRet(2);
      52           7 :     OUString *pArray = aRet.getArray();
      53           7 :     pArray[0] =  "com.sun.star.document.ImportFilter";
      54           7 :     pArray[1] =  "com.sun.star.document.ExtendedTypeDetection";
      55           7 :     return aRet;
      56             : }
      57             : 
      58          89 : Reference< XInterface > SAL_CALL FreehandImportFilter_createInstance(const Reference< XComponentContext > &rContext)
      59             : throw(Exception)
      60             : {
      61          89 :     return static_cast<cppu::OWeakObject *>(new FreehandImportFilter(rContext));
      62             : }
      63             : 
      64             : // XServiceInfo
      65           1 : OUString SAL_CALL FreehandImportFilter::getImplementationName()
      66             : throw (RuntimeException, std::exception)
      67             : {
      68           1 :     return FreehandImportFilter_getImplementationName();
      69             : }
      70           0 : sal_Bool SAL_CALL FreehandImportFilter::supportsService(const OUString &rServiceName)
      71             : throw (RuntimeException, std::exception)
      72             : {
      73           0 :     return cppu::supportsService(this, rServiceName);
      74             : }
      75           1 : Sequence< OUString > SAL_CALL FreehandImportFilter::getSupportedServiceNames()
      76             : throw (RuntimeException, std::exception)
      77             : {
      78           1 :     return FreehandImportFilter_getSupportedServiceNames();
      79             : }
      80             : 
      81             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11