LCOV - code coverage report
Current view: top level - chart2/source/tools - WrappedIgnoreProperty.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 45 50 90.0 %
Date: 2014-11-03 Functions: 10 12 83.3 %
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 "WrappedIgnoreProperty.hxx"
      21             : #include "macros.hxx"
      22             : #include <com/sun/star/awt/Gradient.hpp>
      23             : #include <com/sun/star/drawing/Hatch.hpp>
      24             : #include <com/sun/star/drawing/BitmapMode.hpp>
      25             : #include <com/sun/star/drawing/FillStyle.hpp>
      26             : #include <com/sun/star/drawing/LineDash.hpp>
      27             : #include <com/sun/star/drawing/LineJoint.hpp>
      28             : #include <com/sun/star/drawing/LineStyle.hpp>
      29             : #include <com/sun/star/drawing/RectanglePoint.hpp>
      30             : 
      31             : using namespace ::com::sun::star;
      32             : using ::com::sun::star::uno::Any;
      33             : using ::com::sun::star::uno::Reference;
      34             : 
      35             : namespace chart
      36             : {
      37             : 
      38       19868 : WrappedIgnoreProperty::WrappedIgnoreProperty( const OUString& rOuterName, const Any& rDefaultValue )
      39             :                          : WrappedProperty( rOuterName, OUString() )
      40             :                          , m_aDefaultValue( rDefaultValue )
      41       19868 :                          , m_aCurrentValue( rDefaultValue )
      42             : {
      43       19868 : }
      44       39712 : WrappedIgnoreProperty::~WrappedIgnoreProperty()
      45             : {
      46       39712 : }
      47             : 
      48           8 : void WrappedIgnoreProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
      49             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      50             : {
      51           8 :     m_aCurrentValue = rOuterValue;
      52           8 : }
      53             : 
      54        7997 : Any WrappedIgnoreProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
      55             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      56             : {
      57        7997 :     return m_aCurrentValue;
      58             : }
      59             : 
      60           0 : void WrappedIgnoreProperty::setPropertyToDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
      61             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
      62             : {
      63           0 :     m_aCurrentValue = m_aDefaultValue;
      64           0 : }
      65             : 
      66           0 : Any WrappedIgnoreProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
      67             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      68             : {
      69           0 :     return m_aDefaultValue;
      70             : }
      71             : 
      72       26052 : beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
      73             :                         throw (beans::UnknownPropertyException, uno::RuntimeException)
      74             : {
      75       26052 :     return ( m_aCurrentValue == m_aDefaultValue
      76             :              ? beans::PropertyState_DEFAULT_VALUE
      77       26052 :              : beans::PropertyState_DIRECT_VALUE );
      78             : }
      79             : 
      80         580 : void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< WrappedProperty* >& rList )
      81             : {
      82         580 :     rList.push_back( new WrappedIgnoreProperty( "LineStyle", uno::makeAny( drawing::LineStyle_SOLID ) ) );
      83         580 :     rList.push_back( new WrappedIgnoreProperty( "LineDashName", uno::makeAny( OUString() ) ) );
      84         580 :     rList.push_back( new WrappedIgnoreProperty( "LineColor", uno::makeAny( sal_Int32(0) ) ) );
      85         580 :     rList.push_back( new WrappedIgnoreProperty( "LineTransparence", uno::makeAny( sal_Int16(0) ) ) );
      86         580 :     rList.push_back( new WrappedIgnoreProperty( "LineWidth", uno::makeAny( sal_Int32(0) ) ) );
      87         580 :     rList.push_back( new WrappedIgnoreProperty( "LineJoint", uno::makeAny( drawing::LineJoint_ROUND ) ) );
      88         580 : }
      89             : 
      90         580 : void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< WrappedProperty* >& rList )
      91             : {
      92         580 :     addIgnoreFillProperties_without_BitmapProperties( rList );
      93         580 :     addIgnoreFillProperties_only_BitmapProperties( rList );
      94         580 : }
      95             : 
      96         580 : void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
      97             : {
      98         580 :     rList.push_back( new WrappedIgnoreProperty( "FillStyle", uno::makeAny( drawing::FillStyle_SOLID ) ) );
      99         580 :     rList.push_back( new WrappedIgnoreProperty( "FillColor", uno::makeAny( sal_Int32(-1) ) ) );
     100         580 :     rList.push_back( new WrappedIgnoreProperty( "FillTransparence", uno::makeAny( sal_Int16(0) ) ) );
     101         580 :     rList.push_back( new WrappedIgnoreProperty( "FillTransparenceGradientName", uno::makeAny( OUString() ) ) );
     102             : //    rList.push_back( new WrappedIgnoreProperty( "FillTransparenceGradient", uno::makeAny( awt::Gradient() ) ) );
     103         580 :     rList.push_back( new WrappedIgnoreProperty( "FillGradientName", uno::makeAny( OUString() ) ) );
     104             : //    rList.push_back( new WrappedIgnoreProperty( "FillGradient", uno::makeAny( awt::Gradient() ) ) );
     105         580 :     rList.push_back( new WrappedIgnoreProperty( "FillHatchName", uno::makeAny( OUString() ) ) );
     106             : //    rList.push_back( new WrappedIgnoreProperty( "FillHatch", uno::makeAny( drawing::Hatch() ) ) );
     107         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBackground", uno::makeAny( false ) ) );
     108         580 : }
     109             : 
     110         580 : void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
     111             : {
     112             : //     rList.push_back( new WrappedIgnoreProperty( "FillBitmapName", uno::makeAny( OUString() ) ) );
     113             : //    rList.push_back( new WrappedIgnoreProperty( "FillBitmap", uno::makeAny( uno::Reference< awt::XBitmap > (0) ) ) );
     114             : //    rList.push_back( new WrappedIgnoreProperty( "FillBitmapURL", uno::makeAny( OUString() ) ) );
     115         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapOffsetX", uno::makeAny( sal_Int16(0) ) ) );
     116         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapOffsetY", uno::makeAny( sal_Int16(0) ) ) );
     117         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetX", uno::makeAny( sal_Int16(0) ) ) );
     118         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetY", uno::makeAny( sal_Int16(0) ) ) );
     119         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapRectanglePoint", uno::makeAny( drawing::RectanglePoint_LEFT_TOP ) ) );
     120         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapLogicalSize", uno::makeAny( false ) ) );//todo correct default?
     121         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapSizeX", uno::makeAny( sal_Int32(10) ) ) );//todo which default?
     122         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapSizeY", uno::makeAny( sal_Int32(10) ) ) );//todo which default?
     123         580 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapMode", uno::makeAny( drawing::BitmapMode_REPEAT ) ) );
     124         580 : }
     125             : 
     126             : } //namespace chart
     127             : 
     128             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10