LCOV - code coverage report
Current view: top level - chart2/source/model/main - PolarCoordinateSystem.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 45 66 68.2 %
Date: 2015-06-13 12:38:46 Functions: 21 30 70.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 "PolarCoordinateSystem.hxx"
      21             : #include "macros.hxx"
      22             : #include "servicenames_coosystems.hxx"
      23             : #include <cppuhelper/supportsservice.hxx>
      24             : 
      25             : using namespace ::com::sun::star;
      26             : 
      27             : using ::com::sun::star::uno::RuntimeException;
      28             : using ::com::sun::star::uno::Reference;
      29             : using ::com::sun::star::uno::Sequence;
      30             : 
      31             : namespace
      32             : {
      33             : 
      34             : static const char lcl_aServiceNamePolar2d[] = "com.sun.star.chart2.PolarCoordinateSystem2d";
      35             : static const char lcl_aServiceNamePolar3d[] = "com.sun.star.chart2.PolarCoordinateSystem3d";
      36             : 
      37             : static const char lcl_aImplementationNamePolar2d[] = "com.sun.star.comp.chart2.PolarCoordinateSystem2d";
      38             : static const char lcl_aImplementationNamePolar3d[] = "com.sun.star.comp.chart2.PolarCoordinateSystem3d";
      39             : 
      40             : static const char CHART2_COOSYSTEM_POLAR_SERVICE_NAME[] = "com.sun.star.chart2.CoordinateSystems.Polar";
      41             : 
      42             : }
      43             : 
      44             : namespace chart
      45             : {
      46             : 
      47             : // explicit
      48          75 : PolarCoordinateSystem::PolarCoordinateSystem(
      49             :     const uno::Reference< uno::XComponentContext > & xContext,
      50             :     sal_Int32 nDimensionCount /* = 2 */,
      51             :     bool bSwapXAndYAxis /* = sal_False */ ) :
      52          75 :         BaseCoordinateSystem( xContext, nDimensionCount, bSwapXAndYAxis )
      53          75 : {}
      54             : 
      55           0 : PolarCoordinateSystem::PolarCoordinateSystem(
      56             :     const PolarCoordinateSystem & rSource ) :
      57           0 :         BaseCoordinateSystem( rSource )
      58           0 : {}
      59             : 
      60          82 : PolarCoordinateSystem::~PolarCoordinateSystem()
      61          82 : {}
      62             : 
      63             : // ____ XCoordinateSystem ____
      64           2 : OUString SAL_CALL PolarCoordinateSystem::getCoordinateSystemType()
      65             :     throw (RuntimeException, std::exception)
      66             : {
      67           2 :     return OUString(CHART2_COOSYSTEM_POLAR_SERVICE_NAME);
      68             : }
      69             : 
      70          39 : OUString SAL_CALL PolarCoordinateSystem::getViewServiceName()
      71             :     throw (RuntimeException, std::exception)
      72             : {
      73          39 :     return OUString(CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME);
      74             : }
      75             : 
      76             : // ____ XCloneable ____
      77           0 : uno::Reference< util::XCloneable > SAL_CALL PolarCoordinateSystem::createClone()
      78             :     throw (RuntimeException, std::exception)
      79             : {
      80           0 :     return Reference< util::XCloneable >( new PolarCoordinateSystem( *this ));
      81             : }
      82             : 
      83             : // ____ XServiceInfo ____
      84           0 : Sequence< OUString > PolarCoordinateSystem::getSupportedServiceNames_Static()
      85             : {
      86           0 :     Sequence< OUString > aServices( 1 );
      87           0 :     aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
      88           0 :     return aServices;
      89             : }
      90             : 
      91             : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
      92           0 : OUString SAL_CALL PolarCoordinateSystem::getImplementationName()
      93             :     throw( css::uno::RuntimeException, std::exception )
      94             : {
      95           0 :     return getImplementationName_Static();
      96             : }
      97             : 
      98           0 : OUString PolarCoordinateSystem::getImplementationName_Static()
      99             : {
     100           0 :     return OUString("com.sun.star.comp.chart.PolarCoordinateSystem");
     101             : }
     102             : 
     103           0 : sal_Bool SAL_CALL PolarCoordinateSystem::supportsService( const OUString& rServiceName )
     104             :     throw( css::uno::RuntimeException, std::exception )
     105             : {
     106           0 :     return cppu::supportsService(this, rServiceName);
     107             : }
     108             : 
     109           0 : css::uno::Sequence< OUString > SAL_CALL PolarCoordinateSystem::getSupportedServiceNames()
     110             :     throw( css::uno::RuntimeException, std::exception )
     111             : {
     112           0 :     return getSupportedServiceNames_Static();
     113             : }
     114             : 
     115             : // ==== PolarCoordinateSystem2d ====
     116             : 
     117          57 : PolarCoordinateSystem2d::PolarCoordinateSystem2d(
     118             :     const uno::Reference< uno::XComponentContext > & xContext ) :
     119          57 :         PolarCoordinateSystem( xContext, 2, false )
     120          57 : {}
     121             : 
     122         114 : PolarCoordinateSystem2d::~PolarCoordinateSystem2d()
     123         114 : {}
     124             : 
     125             : // ____ XServiceInfo ____
     126           1 : Sequence< OUString > PolarCoordinateSystem2d::getSupportedServiceNames_Static()
     127             : {
     128           1 :     Sequence< OUString > aServices( 2 );
     129           1 :     aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
     130           1 :     aServices[ 1 ] = lcl_aServiceNamePolar2d;
     131           1 :     return aServices;
     132             : }
     133             : 
     134             : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
     135           1 : OUString SAL_CALL PolarCoordinateSystem2d::getImplementationName()
     136             :     throw( css::uno::RuntimeException, std::exception )
     137             : {
     138           1 :     return getImplementationName_Static();
     139             : }
     140             : 
     141           1 : OUString PolarCoordinateSystem2d::getImplementationName_Static()
     142             : {
     143           1 :     return OUString(lcl_aImplementationNamePolar2d) ;
     144             : }
     145             : 
     146           0 : sal_Bool SAL_CALL PolarCoordinateSystem2d::supportsService( const OUString& rServiceName )
     147             :     throw( css::uno::RuntimeException, std::exception )
     148             : {
     149           0 :     return cppu::supportsService(this, rServiceName);
     150             : }
     151             : 
     152           1 : css::uno::Sequence< OUString > SAL_CALL PolarCoordinateSystem2d::getSupportedServiceNames()
     153             :     throw( css::uno::RuntimeException, std::exception )
     154             : {
     155           1 :     return getSupportedServiceNames_Static();
     156             : }
     157             : 
     158             : // ==== PolarCoordinateSystem3d ====
     159             : 
     160           7 : PolarCoordinateSystem3d::PolarCoordinateSystem3d(
     161             :     const uno::Reference< uno::XComponentContext > & xContext ) :
     162           7 :         PolarCoordinateSystem( xContext, 3, false )
     163           7 : {}
     164             : 
     165          14 : PolarCoordinateSystem3d::~PolarCoordinateSystem3d()
     166          14 : {}
     167             : 
     168             : // ____ XServiceInfo ____
     169           1 : Sequence< OUString > PolarCoordinateSystem3d::getSupportedServiceNames_Static()
     170             : {
     171           1 :     Sequence< OUString > aServices( 2 );
     172           1 :     aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
     173           1 :     aServices[ 1 ] = lcl_aServiceNamePolar3d;
     174           1 :     return aServices;
     175             : }
     176             : 
     177             : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
     178           1 : OUString SAL_CALL PolarCoordinateSystem3d::getImplementationName()
     179             :     throw( css::uno::RuntimeException, std::exception )
     180             : {
     181           1 :     return getImplementationName_Static();
     182             : }
     183             : 
     184           1 : OUString PolarCoordinateSystem3d::getImplementationName_Static()
     185             : {
     186           1 :     return OUString(lcl_aImplementationNamePolar3d);
     187             : }
     188             : 
     189           0 : sal_Bool SAL_CALL PolarCoordinateSystem3d::supportsService( const OUString& rServiceName )
     190             :     throw( css::uno::RuntimeException, std::exception )
     191             : {
     192           0 :     return cppu::supportsService(this, rServiceName);
     193             : }
     194             : 
     195           1 : css::uno::Sequence< OUString > SAL_CALL PolarCoordinateSystem3d::getSupportedServiceNames()
     196             :     throw( css::uno::RuntimeException, std::exception )
     197             : {
     198           1 :     return getSupportedServiceNames_Static();
     199             : }
     200             : 
     201             : }  // namespace chart
     202             : 
     203             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
     204          57 : com_sun_star_comp_chart2_PolarCoordinateSystem2d_get_implementation(css::uno::XComponentContext *context,
     205             :         css::uno::Sequence<css::uno::Any> const &)
     206             : {
     207          57 :     return cppu::acquire(new ::chart::PolarCoordinateSystem2d(context));
     208             : }
     209             : 
     210             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
     211           7 : com_sun_star_comp_chart2_PolarCoordinateSystem3d_get_implementation(css::uno::XComponentContext *context,
     212             :         css::uno::Sequence<css::uno::Any> const &)
     213             : {
     214           7 :     return cppu::acquire(new ::chart::PolarCoordinateSystem3d(context));
     215             : }
     216             : 
     217             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11