LCOV - code coverage report
Current view: top level - chart2/source/controller/chartapiwrapper - WrappedAddInProperty.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 31 48 64.6 %
Date: 2012-08-25 Functions: 16 20 80.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 13 54 24.1 %

           Branch data     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 "WrappedAddInProperty.hxx"
      22                 :            : #include "macros.hxx"
      23                 :            : 
      24                 :            : using ::com::sun::star::uno::Reference;
      25                 :            : using ::com::sun::star::uno::Any;
      26                 :            : using ::rtl::OUString;
      27                 :            : using namespace ::com::sun::star;
      28                 :            : 
      29                 :            : //.............................................................................
      30                 :            : namespace chart
      31                 :            : {
      32                 :            : //.............................................................................
      33                 :            : namespace wrapper
      34                 :            : {
      35                 :            : 
      36                 :         56 : WrappedAddInProperty::WrappedAddInProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      37                 :            :     : ::chart::WrappedProperty( "AddIn", OUString() )
      38         [ +  - ]:         56 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      39                 :            : {
      40                 :         56 : }
      41                 :         56 : WrappedAddInProperty::~WrappedAddInProperty()
      42                 :            : {
      43         [ -  + ]:        112 : }
      44                 :            : 
      45                 :          0 : void WrappedAddInProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      46                 :            :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      47                 :            : {
      48                 :          0 :     Reference< util::XRefreshable > xAddIn;
      49 [ #  # ][ #  # ]:          0 :     if( ! (rOuterValue >>= xAddIn) )
      50 [ #  # ][ #  # ]:          0 :         throw lang::IllegalArgumentException( "AddIn properties require type XRefreshable", 0, 0 );
      51                 :            : 
      52         [ #  # ]:          0 :     m_rChartDocumentWrapper.setAddIn( xAddIn );
      53                 :          0 : }
      54                 :            : 
      55                 :        878 : Any WrappedAddInProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      56                 :            :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      57                 :            : {
      58         [ +  - ]:        878 :     return uno::makeAny( m_rChartDocumentWrapper.getAddIn() );
      59                 :            : }
      60                 :            : 
      61                 :            : //.............................................................................
      62                 :            : 
      63                 :         56 : WrappedBaseDiagramProperty::WrappedBaseDiagramProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      64                 :            :     : ::chart::WrappedProperty( "BaseDiagram" , OUString() )
      65         [ +  - ]:         56 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      66                 :            : {
      67                 :         56 : }
      68                 :         56 : WrappedBaseDiagramProperty::~WrappedBaseDiagramProperty()
      69                 :            : {
      70         [ -  + ]:        112 : }
      71                 :            : 
      72                 :          0 : void WrappedBaseDiagramProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      73                 :            :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      74                 :            : {
      75                 :          0 :     rtl::OUString aBaseDiagram;
      76         [ #  # ]:          0 :     if( ! (rOuterValue >>= aBaseDiagram) )
      77 [ #  # ][ #  # ]:          0 :         throw lang::IllegalArgumentException( "BaseDiagram properties require type OUString", 0, 0 );
      78                 :            : 
      79         [ #  # ]:          0 :     m_rChartDocumentWrapper.setBaseDiagram( aBaseDiagram );
      80                 :          0 : }
      81                 :            : 
      82                 :          0 : Any WrappedBaseDiagramProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      83                 :            :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      84                 :            : {
      85         [ #  # ]:          0 :     return uno::makeAny( m_rChartDocumentWrapper.getBaseDiagram() );
      86                 :            : }
      87                 :            : 
      88                 :            : //.............................................................................
      89                 :            : 
      90                 :         56 : WrappedAdditionalShapesProperty::WrappedAdditionalShapesProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      91                 :            :     : ::chart::WrappedProperty( "AdditionalShapes" , OUString() )
      92         [ +  - ]:         56 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      93                 :            : {
      94                 :         56 : }
      95                 :         56 : WrappedAdditionalShapesProperty::~WrappedAdditionalShapesProperty()
      96                 :            : {
      97         [ -  + ]:        112 : }
      98                 :            : 
      99                 :          0 : void WrappedAdditionalShapesProperty::setPropertyValue( const Any& /*rOuterValue*/, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
     100                 :            :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     101                 :            : {
     102 [ #  # ][ #  # ]:          0 :     throw lang::IllegalArgumentException( "AdditionalShapes is a read only property", 0, 0 );
     103                 :            : }
     104                 :            : 
     105                 :         41 : Any WrappedAdditionalShapesProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
     106                 :            :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     107                 :            : {
     108         [ +  - ]:         41 :     return uno::makeAny( m_rChartDocumentWrapper.getAdditionalShapes() );
     109                 :            : }
     110                 :            : 
     111                 :            : //.............................................................................
     112                 :            : 
     113                 :         56 : WrappedRefreshAddInAllowedProperty::WrappedRefreshAddInAllowedProperty( ChartDocumentWrapper& rChartDocumentWrapper )
     114                 :            :     : ::chart::WrappedProperty( "RefreshAddInAllowed" , OUString() )
     115         [ +  - ]:         56 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
     116                 :            : {
     117                 :         56 : }
     118                 :         56 : WrappedRefreshAddInAllowedProperty::~WrappedRefreshAddInAllowedProperty()
     119                 :            : {
     120         [ -  + ]:        112 : }
     121                 :            : 
     122                 :         10 : void WrappedRefreshAddInAllowedProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
     123                 :            :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     124                 :            : {
     125                 :         10 :     sal_Bool bUpdateAddIn = sal_True;
     126         [ -  + ]:         10 :     if( ! (rOuterValue >>= bUpdateAddIn) )
     127 [ #  # ][ #  # ]:          0 :         throw lang::IllegalArgumentException( "The property RefreshAddInAllowed requires type boolean", 0, 0 );
     128                 :            : 
     129         [ +  - ]:         10 :     m_rChartDocumentWrapper.setUpdateAddIn( bUpdateAddIn );
     130                 :         10 : }
     131                 :            : 
     132                 :         10 : Any WrappedRefreshAddInAllowedProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
     133                 :            :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     134                 :            : {
     135         [ +  - ]:         10 :     return uno::makeAny( m_rChartDocumentWrapper.getUpdateAddIn() );
     136                 :            : }
     137                 :            : 
     138                 :            : } //namespace wrapper
     139                 :            : 
     140                 :            : } //namespace chart
     141                 :            : 
     142                 :            : 
     143                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10