LCOV - code coverage report
Current view: top level - chart2/source/controller/chartapiwrapper - WrappedAddInProperty.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 31 48 64.6 %
Date: 2015-06-13 12:38:46 Functions: 16 20 80.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 "WrappedAddInProperty.hxx"
      21             : #include "macros.hxx"
      22             : 
      23             : using ::com::sun::star::uno::Reference;
      24             : using ::com::sun::star::uno::Any;
      25             : using namespace ::com::sun::star;
      26             : 
      27             : namespace chart
      28             : {
      29             : namespace wrapper
      30             : {
      31             : 
      32         320 : WrappedAddInProperty::WrappedAddInProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      33             :     : ::chart::WrappedProperty( "AddIn", OUString() )
      34         320 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      35             : {
      36         320 : }
      37         640 : WrappedAddInProperty::~WrappedAddInProperty()
      38             : {
      39         640 : }
      40             : 
      41           0 : void WrappedAddInProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      42             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      43             : {
      44           0 :     Reference< util::XRefreshable > xAddIn;
      45           0 :     if( ! (rOuterValue >>= xAddIn) )
      46           0 :         throw lang::IllegalArgumentException( "AddIn properties require type XRefreshable", 0, 0 );
      47             : 
      48           0 :     m_rChartDocumentWrapper.setAddIn( xAddIn );
      49           0 : }
      50             : 
      51        2084 : Any WrappedAddInProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      52             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      53             : {
      54        2084 :     return uno::makeAny( m_rChartDocumentWrapper.getAddIn() );
      55             : }
      56             : 
      57         320 : WrappedBaseDiagramProperty::WrappedBaseDiagramProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      58             :     : ::chart::WrappedProperty( "BaseDiagram" , OUString() )
      59         320 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      60             : {
      61         320 : }
      62         640 : WrappedBaseDiagramProperty::~WrappedBaseDiagramProperty()
      63             : {
      64         640 : }
      65             : 
      66           0 : void WrappedBaseDiagramProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      67             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      68             : {
      69           0 :     OUString aBaseDiagram;
      70           0 :     if( ! (rOuterValue >>= aBaseDiagram) )
      71           0 :         throw lang::IllegalArgumentException( "BaseDiagram properties require type OUString", 0, 0 );
      72             : 
      73           0 :     m_rChartDocumentWrapper.setBaseDiagram( aBaseDiagram );
      74           0 : }
      75             : 
      76           0 : Any WrappedBaseDiagramProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      77             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      78             : {
      79           0 :     return uno::makeAny( m_rChartDocumentWrapper.getBaseDiagram() );
      80             : }
      81             : 
      82         320 : WrappedAdditionalShapesProperty::WrappedAdditionalShapesProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      83             :     : ::chart::WrappedProperty( "AdditionalShapes" , OUString() )
      84         320 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      85             : {
      86         320 : }
      87         640 : WrappedAdditionalShapesProperty::~WrappedAdditionalShapesProperty()
      88             : {
      89         640 : }
      90             : 
      91           0 : void WrappedAdditionalShapesProperty::setPropertyValue( const Any& /*rOuterValue*/, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      92             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      93             : {
      94           0 :     throw lang::IllegalArgumentException( "AdditionalShapes is a read only property", 0, 0 );
      95             : }
      96             : 
      97         542 : Any WrappedAdditionalShapesProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      98             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      99             : {
     100         542 :     return uno::makeAny( m_rChartDocumentWrapper.getAdditionalShapes() );
     101             : }
     102             : 
     103         320 : WrappedRefreshAddInAllowedProperty::WrappedRefreshAddInAllowedProperty( ChartDocumentWrapper& rChartDocumentWrapper )
     104             :     : ::chart::WrappedProperty( "RefreshAddInAllowed" , OUString() )
     105         320 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
     106             : {
     107         320 : }
     108         640 : WrappedRefreshAddInAllowedProperty::~WrappedRefreshAddInAllowedProperty()
     109             : {
     110         640 : }
     111             : 
     112          88 : void WrappedRefreshAddInAllowedProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
     113             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     114             : {
     115          88 :     bool bUpdateAddIn = true;
     116          88 :     if( ! (rOuterValue >>= bUpdateAddIn) )
     117           0 :         throw lang::IllegalArgumentException( "The property RefreshAddInAllowed requires type boolean", 0, 0 );
     118             : 
     119          88 :     m_rChartDocumentWrapper.setUpdateAddIn( bUpdateAddIn );
     120          88 : }
     121             : 
     122           5 : Any WrappedRefreshAddInAllowedProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
     123             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     124             : {
     125           5 :     return uno::makeAny( m_rChartDocumentWrapper.getUpdateAddIn() );
     126             : }
     127             : 
     128             : } //namespace wrapper
     129             : 
     130             : } //namespace chart
     131             : 
     132             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11