LCOV - code coverage report
Current view: top level - libreoffice/xmlsecurity/source/xmlsec - xsec_xmlsec.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 11 17 64.7 %
Date: 2012-12-27 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             : 
      21             : #include <sal/config.h>
      22             : 
      23             : #include <cppuhelper/factory.hxx>
      24             : 
      25             : #include "serialnumberadapter.hxx"
      26             : #include "xmlelementwrapper_xmlsecimpl.hxx"
      27             : #include "xmldocumentwrapper_xmlsecimpl.hxx"
      28             : 
      29             : using namespace ::cppu;
      30             : using namespace ::com::sun::star::uno;
      31             : using namespace ::com::sun::star::lang;
      32             : 
      33             : extern "C"
      34             : {
      35             : 
      36             : extern void* nss_component_getFactory( const sal_Char*, void*, void* );
      37             : 
      38             : #if defined( XMLSEC_CRYPTO_MSCRYPTO )
      39             : extern void* mscrypt_component_getFactory( const sal_Char*, void*, void* );
      40             : #endif
      41             : 
      42           2 : SAL_DLLPUBLIC_EXPORT void* SAL_CALL xsec_xmlsec_component_getFactory( const sal_Char* pImplName , void* pServiceManager , void* pRegistryKey )
      43             : {
      44           2 :     void* pRet = 0;
      45           2 :     Reference< XInterface > xFactory ;
      46             : 
      47           2 :     if( pImplName != NULL ) {
      48           2 :         if( XMLElementWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
      49             :         {
      50             :             xFactory = cppu::createSingleComponentFactory(
      51             :                 XMLElementWrapper_XmlSecImpl_createInstance,
      52             :                 OUString::createFromAscii( pImplName ),
      53           0 :                 XMLElementWrapper_XmlSecImpl_getSupportedServiceNames() );
      54             :         }
      55           2 :         else if( XMLDocumentWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) )
      56             :         {
      57             :             xFactory = cppu::createSingleComponentFactory(
      58             :                 XMLDocumentWrapper_XmlSecImpl_createInstance,
      59             :                 OUString::createFromAscii( pImplName ),
      60           0 :                 XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames() );
      61             :         }
      62           2 :         else if( xml_security::serial_number_adapter::implementationName().equals( OUString::createFromAscii( pImplName ) ) )
      63             :         {
      64             :             xFactory = ::cppu::createSingleComponentFactory(
      65             :               xml_security::serial_number_adapter::create,
      66             :               OUString::createFromAscii( pImplName ),
      67           0 :               xml_security::serial_number_adapter::serviceNames() );
      68             :         }
      69             :     }
      70             : 
      71           2 :     if( xFactory.is() ) {
      72           0 :         xFactory->acquire() ;
      73           0 :         pRet = xFactory.get() ;
      74             :     } else {
      75           2 :         pRet = nss_component_getFactory( pImplName, pServiceManager, pRegistryKey ) ;
      76           2 :         if( pRet != NULL )
      77           2 :             return pRet ;
      78             : 
      79             : #if defined( XMLSEC_CRYPTO_MSCRYPTO )
      80             :         pRet = mscrypt_component_getFactory( pImplName, pServiceManager, pRegistryKey ) ;
      81             :         if( pRet != NULL )
      82             :             return pRet ;
      83             : #endif
      84             :     }
      85             : 
      86           0 :     return pRet ;
      87             : }
      88             : 
      89             : }
      90             : 
      91             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10