LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/drawinglayer/source/drawinglayeruno - drawinglayeruno.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 13 13 100.0 %
Date: 2013-07-09 Functions: 2 2 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 <drawinglayer/drawinglayerdllapi.h>
      21             : #include <com/sun/star/uno/Reference.h>
      22             : #include <com/sun/star/uno/RuntimeException.hpp>
      23             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      24             : #include <com/sun/star/lang/XComponent.hpp>
      25             : #include <com/sun/star/registry/XRegistryKey.hpp>
      26             : #include <com/sun/star/lang/XServiceInfo.hpp>
      27             : #include <com/sun/star/lang/XSingleServiceFactory.hpp>
      28             : #include <uno/environment.h>
      29             : #include <cppuhelper/factory.hxx>
      30             : 
      31             : //////////////////////////////////////////////////////////////////////////////
      32             : 
      33             : using namespace ::com::sun::star;
      34             : 
      35             : //////////////////////////////////////////////////////////////////////////////
      36             : // predefines
      37             : 
      38             : namespace drawinglayer
      39             : {
      40             :     namespace unorenderer
      41             :     {
      42             :         extern uno::Sequence< OUString > SAL_CALL XPrimitive2DRenderer_getSupportedServiceNames();
      43             :         extern OUString SAL_CALL XPrimitive2DRenderer_getImplementationName();
      44             :         extern uno::Reference< uno::XInterface > SAL_CALL XPrimitive2DRenderer_createInstance( const uno::Reference< lang::XMultiServiceFactory > & );
      45             :     } // end of namespace unorenderer
      46             : } // end of namespace drawinglayer
      47             : 
      48             : //////////////////////////////////////////////////////////////////////////////
      49             : // component_getImplementationEnvironment
      50             : 
      51             : extern "C"
      52             : {
      53           4 :     DRAWINGLAYER_DLLPUBLIC void SAL_CALL drawinglayer_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
      54             :     {
      55           4 :         *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
      56           4 :     }
      57             : }
      58             : 
      59             : //////////////////////////////////////////////////////////////////////////////
      60             : // component_getFactory
      61             : 
      62             : extern "C"
      63             : {
      64           4 :     DRAWINGLAYER_DLLPUBLIC void* SAL_CALL drawinglayer_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
      65             :     {
      66           4 :         uno::Reference< lang::XSingleServiceFactory > xFactory;
      67           4 :         void* pRet = 0;
      68             : 
      69           4 :         if(drawinglayer::unorenderer::XPrimitive2DRenderer_getImplementationName().equalsAscii(pImplName))
      70             :         {
      71           8 :             xFactory = ::cppu::createSingleFactory(
      72             :                 reinterpret_cast< lang::XMultiServiceFactory * >(pServiceManager),
      73             :                 drawinglayer::unorenderer::XPrimitive2DRenderer_getImplementationName(),
      74             :                 drawinglayer::unorenderer::XPrimitive2DRenderer_createInstance,
      75           4 :                 drawinglayer::unorenderer::XPrimitive2DRenderer_getSupportedServiceNames());
      76             :         }
      77             : 
      78           4 :         if(xFactory.is())
      79             :         {
      80           4 :             xFactory->acquire();
      81           4 :             pRet = xFactory.get();
      82             :         }
      83             : 
      84           4 :         return pRet;
      85             :     }
      86             : }
      87             : 
      88             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10