LCOV - code coverage report
Current view: top level - cppuhelper/source - implementationentry.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 15 29 51.7 %
Date: 2014-04-11 Functions: 1 2 50.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 <cppuhelper/implementationentry.hxx>
      21             : 
      22             : using namespace ::com::sun::star::uno;
      23             : using namespace ::com::sun::star::lang;
      24             : using namespace ::com::sun::star::registry;
      25             : 
      26             : using rtl::OUString;
      27             : 
      28             : namespace cppu {
      29             : 
      30           0 : sal_Bool component_writeInfoHelper(
      31             :     SAL_UNUSED_PARAMETER void *, void * pRegistryKey,
      32             :     ImplementationEntry const * entries)
      33             : {
      34           0 :     bool bRet = false;
      35             :     try
      36             :     {
      37           0 :         if( pRegistryKey )
      38             :         {
      39           0 :             for( sal_Int32 i = 0; entries[i].create ; i ++ )
      40             :             {
      41           0 :                 OUString sKey = "/" + entries[i].getImplementationName() + "/UNO/SERVICES";
      42             :                 Reference< XRegistryKey > xNewKey(
      43           0 :                     reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( sKey ) );
      44             : 
      45           0 :                 Sequence< OUString > seq = entries[i].getSupportedServiceNames();
      46           0 :                 const OUString *pArray = seq.getConstArray();
      47           0 :                 for ( sal_Int32 nPos = 0 ; nPos < seq.getLength(); nPos ++ )
      48           0 :                     xNewKey->createKey( pArray[nPos] );
      49           0 :             }
      50           0 :             bRet = true;
      51             :         }
      52             :     }
      53           0 :     catch ( InvalidRegistryException & )
      54             :     {
      55             :         OSL_FAIL( "### InvalidRegistryException!" );
      56             :     }
      57           0 :     return bRet;
      58             : }
      59             : 
      60             : 
      61        1849 : void * component_getFactoryHelper(
      62             :     char const * pImplName, SAL_UNUSED_PARAMETER void *,
      63             :     SAL_UNUSED_PARAMETER void *, ImplementationEntry const * entries)
      64             : {
      65             : 
      66        1849 :       void * pRet = 0;
      67        1849 :     Reference< XSingleComponentFactory > xFactory;
      68             : 
      69       14341 :     for( sal_Int32 i = 0 ; entries[i].create ; i ++ )
      70             :     {
      71       12492 :         OUString implName = entries[i].getImplementationName();
      72       12492 :         if( implName.equalsAscii( pImplName ) )
      73             :         {
      74        8495 :             xFactory = entries[i].createFactory(
      75        1699 :                 entries[i].create,
      76             :                 implName,
      77        1699 :                 entries[i].getSupportedServiceNames(),
      78        3398 :                 entries[i].moduleCounter );
      79             :         }
      80       12492 :     }
      81             : 
      82        1849 :     if( xFactory.is() )
      83             :     {
      84        1699 :         xFactory->acquire();
      85        1699 :         pRet = xFactory.get();
      86             :     }
      87        1849 :     return pRet;
      88             : }
      89             : 
      90             : }
      91             : 
      92             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10