LCOV - code coverage report
Current view: top level - chart2/source/controller/chartapiwrapper - WrappedCharacterHeightProperty.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 55 0.0 %
Date: 2014-04-14 Functions: 0 19 0.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 "WrappedCharacterHeightProperty.hxx"
      21             : #include "macros.hxx"
      22             : #include "RelativeSizeHelper.hxx"
      23             : #include "ReferenceSizePropertyProvider.hxx"
      24             : 
      25             : using namespace ::com::sun::star;
      26             : using ::com::sun::star::uno::Reference;
      27             : using ::com::sun::star::uno::Any;
      28             : 
      29             : namespace chart
      30             : {
      31             : namespace wrapper
      32             : {
      33           0 : WrappedCharacterHeightProperty_Base::WrappedCharacterHeightProperty_Base(
      34             :                             const OUString& rOuterEqualsInnerName
      35             :                             , ReferenceSizePropertyProvider* pRefSizePropProvider )
      36             :                             : WrappedProperty( rOuterEqualsInnerName, rOuterEqualsInnerName )
      37           0 :                            , m_pRefSizePropProvider( pRefSizePropProvider )
      38             : {
      39           0 : }
      40           0 : WrappedCharacterHeightProperty_Base::~WrappedCharacterHeightProperty_Base()
      41             : {
      42           0 : }
      43             : 
      44           0 : void WrappedCharacterHeightProperty::addWrappedProperties( std::vector< WrappedProperty* >& rList
      45             :             , ReferenceSizePropertyProvider* pRefSizePropProvider  )
      46             : {
      47           0 :     rList.push_back( new WrappedCharacterHeightProperty( pRefSizePropProvider ) );
      48           0 :     rList.push_back( new WrappedAsianCharacterHeightProperty( pRefSizePropProvider ) );
      49           0 :     rList.push_back( new WrappedComplexCharacterHeightProperty( pRefSizePropProvider ) );
      50           0 : }
      51             : 
      52           0 : void WrappedCharacterHeightProperty_Base::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
      53             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      54             : {
      55           0 :     if(xInnerPropertySet.is())
      56             :     {
      57           0 :         if( m_pRefSizePropProvider )
      58           0 :             m_pRefSizePropProvider->updateReferenceSize();
      59           0 :         xInnerPropertySet->setPropertyValue( m_aInnerName, rOuterValue );
      60             :     }
      61           0 : }
      62             : 
      63           0 : Any WrappedCharacterHeightProperty_Base::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
      64             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      65             : {
      66           0 :     Any aRet;
      67           0 :     if( xInnerPropertySet.is() )
      68             :     {
      69           0 :         aRet = xInnerPropertySet->getPropertyValue( m_aInnerName );
      70           0 :         float fHeight = 0;
      71           0 :         if( aRet >>= fHeight )
      72             :         {
      73           0 :             if( m_pRefSizePropProvider )
      74             :             {
      75           0 :                 awt::Size aReferenceSize;
      76           0 :                 if( m_pRefSizePropProvider->getReferenceSize() >>= aReferenceSize )
      77             :                 {
      78           0 :                     awt::Size aCurrentSize = m_pRefSizePropProvider->getCurrentSizeForReference();
      79           0 :                     aRet <<= static_cast< float >(
      80           0 :                             RelativeSizeHelper::calculate( fHeight, aReferenceSize, aCurrentSize ));
      81             :                 }
      82             :             }
      83             :         }
      84             :     }
      85           0 :     return aRet;
      86             : }
      87             : 
      88           0 : Any WrappedCharacterHeightProperty_Base::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
      89             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      90             : {
      91           0 :     Any aRet;
      92           0 :     if( xInnerPropertyState.is() )
      93             :     {
      94           0 :         aRet = xInnerPropertyState->getPropertyDefault( m_aInnerName );
      95             :     }
      96           0 :     return aRet;
      97             : }
      98             : 
      99           0 : beans::PropertyState WrappedCharacterHeightProperty_Base::getPropertyState( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
     100             :                         throw (beans::UnknownPropertyException, uno::RuntimeException)
     101             : {
     102           0 :     return beans::PropertyState_DIRECT_VALUE;
     103             : }
     104             : 
     105           0 : Any WrappedCharacterHeightProperty_Base::convertInnerToOuterValue( const Any& rInnerValue ) const
     106             : {
     107             :     OSL_FAIL("should not be used: WrappedCharacterHeightProperty_Base::convertInnerToOuterValue - check if you miss data");
     108           0 :     return rInnerValue;
     109             : }
     110           0 : Any WrappedCharacterHeightProperty_Base::convertOuterToInnerValue( const Any& rOuterValue ) const
     111             : {
     112             :     OSL_FAIL("should not be used: WrappedCharacterHeightProperty_Base::convertOuterToInnerValue - check if you miss data");
     113           0 :     return rOuterValue;
     114             : }
     115             : 
     116           0 : WrappedCharacterHeightProperty::WrappedCharacterHeightProperty( ReferenceSizePropertyProvider* pRefSizePropProvider )
     117           0 :         : WrappedCharacterHeightProperty_Base( "CharHeight", pRefSizePropProvider )
     118             : {
     119           0 : }
     120           0 : WrappedCharacterHeightProperty::~WrappedCharacterHeightProperty()
     121             : {
     122           0 : }
     123             : 
     124           0 : WrappedAsianCharacterHeightProperty::WrappedAsianCharacterHeightProperty( ReferenceSizePropertyProvider* pRefSizePropProvider )
     125           0 :         : WrappedCharacterHeightProperty_Base( "CharHeightAsian", pRefSizePropProvider )
     126             : {
     127           0 : }
     128           0 : WrappedAsianCharacterHeightProperty::~WrappedAsianCharacterHeightProperty()
     129             : {
     130           0 : }
     131             : 
     132           0 : WrappedComplexCharacterHeightProperty::WrappedComplexCharacterHeightProperty( ReferenceSizePropertyProvider* pRefSizePropProvider )
     133           0 :         : WrappedCharacterHeightProperty_Base( "CharHeightComplex", pRefSizePropProvider )
     134             : {
     135           0 : }
     136           0 : WrappedComplexCharacterHeightProperty::~WrappedComplexCharacterHeightProperty()
     137             : {
     138           0 : }
     139             : 
     140             : } //namespace wrapper
     141             : } //namespace chart
     142             : 
     143             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10