LCOV - code coverage report
Current view: top level - filter/source/config/cache - registration.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 25 0.0 %
Date: 2014-04-14 Functions: 0 1 0.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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include <cppuhelper/factory.hxx>
      22             : #include <rtl/instance.hxx>
      23             : 
      24             : #include "typedetection.hxx"
      25             : #include "filterfactory.hxx"
      26             : #include "contenthandlerfactory.hxx"
      27             : #include "frameloaderfactory.hxx"
      28             : #include "configflush.hxx"
      29             : 
      30             : 
      31             : namespace filter{
      32             :     namespace config{
      33             : 
      34             : 
      35             : extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL
      36           0 :     filterconfig1_component_getFactory( const sal_Char* pImplementationName,
      37             :                                         void* pServiceManager,
      38             :                                         void* /* pRegistryKey */ )
      39             : {
      40           0 :     if ((!pImplementationName) || (!pServiceManager ))
      41           0 :         return NULL;
      42             : 
      43             :     com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
      44           0 :         xSMGR = reinterpret_cast< com::sun::star::lang::XMultiServiceFactory* >(pServiceManager);
      45           0 :     com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xFactory;
      46           0 :     OUString sImplName = OUString::createFromAscii(pImplementationName);
      47             : 
      48           0 :     if (TypeDetection::impl_getImplementationName() == sImplName)
      49           0 :         xFactory = cppu::createSingleFactory( xSMGR,
      50             :                                               TypeDetection::impl_getImplementationName(),
      51             :                                               TypeDetection::impl_createInstance,
      52           0 :                                               TypeDetection::impl_getSupportedServiceNames() );
      53             : 
      54           0 :     if (FilterFactory::impl_getImplementationName() == sImplName)
      55           0 :         xFactory = cppu::createSingleFactory( xSMGR,
      56             :                                               FilterFactory::impl_getImplementationName(),
      57             :                                               FilterFactory::impl_createInstance,
      58           0 :                                               FilterFactory::impl_getSupportedServiceNames() );
      59             : 
      60           0 :     if (ContentHandlerFactory::impl_getImplementationName() == sImplName)
      61           0 :         xFactory = cppu::createSingleFactory( xSMGR,
      62             :                                               ContentHandlerFactory::impl_getImplementationName(),
      63             :                                               ContentHandlerFactory::impl_createInstance,
      64           0 :                                               ContentHandlerFactory::impl_getSupportedServiceNames() );
      65             : 
      66           0 :     if (FrameLoaderFactory::impl_getImplementationName() == sImplName)
      67           0 :         xFactory = cppu::createSingleFactory( xSMGR,
      68             :                                               FrameLoaderFactory::impl_getImplementationName(),
      69             :                                               FrameLoaderFactory::impl_createInstance,
      70           0 :                                               FrameLoaderFactory::impl_getSupportedServiceNames() );
      71             : 
      72           0 :     if (ConfigFlush::impl_getImplementationName() == sImplName)
      73           0 :         xFactory = cppu::createOneInstanceFactory( xSMGR,
      74             :                                                    ConfigFlush::impl_getImplementationName(),
      75             :                                                    ConfigFlush::impl_createInstance,
      76           0 :                                                    ConfigFlush::impl_getSupportedServiceNames() );
      77             : 
      78             :     /* And if one of these checks was successful => xFactory was set! */
      79           0 :     if (xFactory.is())
      80             :     {
      81           0 :         xFactory->acquire();
      82           0 :         return xFactory.get();
      83             :     }
      84             : 
      85           0 :     return NULL;
      86             : }
      87             : 
      88             :     } // namespace config
      89             : } // namespace filter
      90             : 
      91             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10