LCOV - code coverage report
Current view: top level - svl/source/uno - registerservices.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 30 30 100.0 %
Date: 2014-11-03 Functions: 1 1 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             :  * 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             : #include <sal/types.h>
      21             : #include <rtl/ustring.hxx>
      22             : #include <cppuhelper/factory.hxx>
      23             : #include <com/sun/star/lang/XSingleServiceFactory.hpp>
      24             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      25             : #include <com/sun/star/registry/XRegistryKey.hpp>
      26             : #include <svl/svldllapi.h>
      27             : 
      28             : #include <registerservices.hxx>
      29             : 
      30             : using css::uno::Reference;
      31             : using css::uno::Sequence;
      32             : 
      33             : extern "C"
      34             : {
      35             : 
      36          74 : SVL_DLLPUBLIC void* SAL_CALL svl_component_getFactory (
      37             :     const sal_Char * pImplementationName, void * _pServiceManager,
      38             :     SAL_UNUSED_PARAMETER void * /* _pRegistryKey*/)
      39             : {
      40          74 :     void * pResult = 0;
      41          74 :     if ( _pServiceManager )
      42             :     {
      43          74 :         Reference< css::lang::XSingleServiceFactory > xFactory;
      44          74 :         if (rtl_str_compare(
      45             :                 pImplementationName,
      46          74 :                 "com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject") == 0)
      47             :         {
      48          40 :             Sequence< OUString > aServiceNames(1);
      49          80 :             aServiceNames.getArray()[0] =
      50          40 :                 OUString("com.sun.star.util.NumberFormatsSupplier");
      51             : 
      52          80 :             xFactory = ::cppu::createSingleFactory(
      53             :                 reinterpret_cast< css::lang::XMultiServiceFactory* >(_pServiceManager),
      54             :                 OUString::createFromAscii( pImplementationName ),
      55             :                 SvNumberFormatsSupplierServiceObject_CreateInstance,
      56          80 :                 aServiceNames);
      57             :         }
      58          34 :         else if (rtl_str_compare(
      59             :                      pImplementationName,
      60          34 :                      "com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject") == 0)
      61             :         {
      62          32 :             Sequence< OUString > aServiceNames(1);
      63          64 :             aServiceNames.getArray()[0] =
      64          32 :                 OUString("com.sun.star.util.NumberFormatter");
      65             : 
      66          64 :             xFactory = ::cppu::createSingleFactory(
      67             :                 reinterpret_cast< css::lang::XMultiServiceFactory* >(_pServiceManager),
      68             :                 OUString::createFromAscii( pImplementationName ),
      69             :                 SvNumberFormatterServiceObj_CreateInstance,
      70          64 :                 aServiceNames);
      71             :         }
      72           2 :         else if (rtl_str_compare (
      73           2 :                      pImplementationName, "com.sun.star.comp.svl.PathService") == 0)
      74             :         {
      75           2 :             Sequence< OUString > aServiceNames(1);
      76           4 :             aServiceNames.getArray()[0] =
      77           2 :                 OUString("com.sun.star.config.SpecialConfigManager");
      78           4 :             xFactory = ::cppu::createSingleFactory (
      79             :                 reinterpret_cast< css::lang::XMultiServiceFactory* >( _pServiceManager ),
      80             :                 OUString::createFromAscii( pImplementationName ),
      81             :                 PathService_CreateInstance,
      82           4 :                 aServiceNames);
      83             :         }
      84          74 :         if ( xFactory.is() )
      85             :         {
      86          74 :             xFactory->acquire();
      87          74 :             pResult = xFactory.get();
      88          74 :         }
      89             :     }
      90          74 :     return pResult;
      91             : }
      92             : 
      93             : }   // "C"
      94             : 
      95             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10