LCOV - code coverage report
Current view: top level - chart2/source/controller/chartapiwrapper - WrappedAddInProperty.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 31 48 64.6 %
Date: 2014-04-11 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         217 : WrappedAddInProperty::WrappedAddInProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      33             :     : ::chart::WrappedProperty( "AddIn", OUString() )
      34         217 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      35             : {
      36         217 : }
      37         422 : WrappedAddInProperty::~WrappedAddInProperty()
      38             : {
      39         422 : }
      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        1193 : Any WrappedAddInProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      52             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      53             : {
      54        1193 :     return uno::makeAny( m_rChartDocumentWrapper.getAddIn() );
      55             : }
      56             : 
      57         217 : WrappedBaseDiagramProperty::WrappedBaseDiagramProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      58             :     : ::chart::WrappedProperty( "BaseDiagram" , OUString() )
      59         217 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      60             : {
      61         217 : }
      62         422 : WrappedBaseDiagramProperty::~WrappedBaseDiagramProperty()
      63             : {
      64         422 : }
      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         217 : WrappedAdditionalShapesProperty::WrappedAdditionalShapesProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      83             :     : ::chart::WrappedProperty( "AdditionalShapes" , OUString() )
      84         217 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      85             : {
      86         217 : }
      87         422 : WrappedAdditionalShapesProperty::~WrappedAdditionalShapesProperty()
      88             : {
      89         422 : }
      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         464 : Any WrappedAdditionalShapesProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      98             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      99             : {
     100         464 :     return uno::makeAny( m_rChartDocumentWrapper.getAdditionalShapes() );
     101             : }
     102             : 
     103         217 : WrappedRefreshAddInAllowedProperty::WrappedRefreshAddInAllowedProperty( ChartDocumentWrapper& rChartDocumentWrapper )
     104             :     : ::chart::WrappedProperty( "RefreshAddInAllowed" , OUString() )
     105         217 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
     106             : {
     107         217 : }
     108         422 : WrappedRefreshAddInAllowedProperty::~WrappedRefreshAddInAllowedProperty()
     109             : {
     110         422 : }
     111             : 
     112          85 : 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          85 :     sal_Bool bUpdateAddIn = sal_True;
     116          85 :     if( ! (rOuterValue >>= bUpdateAddIn) )
     117           0 :         throw lang::IllegalArgumentException( "The property RefreshAddInAllowed requires type boolean", 0, 0 );
     118             : 
     119          85 :     m_rChartDocumentWrapper.setUpdateAddIn( bUpdateAddIn );
     120          85 : }
     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.10