LCOV - code coverage report
Current view: top level - chart2/source/tools - WrappedIgnoreProperty.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 45 50 90.0 %
Date: 2015-06-13 12:38:46 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       10308 : WrappedIgnoreProperty::WrappedIgnoreProperty( const OUString& rOuterName, const Any& rDefaultValue )
      39             :                          : WrappedProperty( rOuterName, OUString() )
      40             :                          , m_aDefaultValue( rDefaultValue )
      41       10308 :                          , m_aCurrentValue( rDefaultValue )
      42             : {
      43       10308 : }
      44       20601 : WrappedIgnoreProperty::~WrappedIgnoreProperty()
      45             : {
      46       20601 : }
      47             : 
      48           4 : 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           4 :     m_aCurrentValue = rOuterValue;
      52           4 : }
      53             : 
      54        6846 : Any WrappedIgnoreProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
      55             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      56             : {
      57        6846 :     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       12990 : beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
      73             :                         throw (beans::UnknownPropertyException, uno::RuntimeException)
      74             : {
      75       12990 :     return ( m_aCurrentValue == m_aDefaultValue
      76             :              ? beans::PropertyState_DEFAULT_VALUE
      77       12990 :              : beans::PropertyState_DIRECT_VALUE );
      78             : }
      79             : 
      80         307 : void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< WrappedProperty* >& rList )
      81             : {
      82         307 :     rList.push_back( new WrappedIgnoreProperty( "LineStyle", uno::makeAny( drawing::LineStyle_SOLID ) ) );
      83         307 :     rList.push_back( new WrappedIgnoreProperty( "LineDashName", uno::makeAny( OUString() ) ) );
      84         307 :     rList.push_back( new WrappedIgnoreProperty( "LineColor", uno::makeAny( sal_Int32(0) ) ) );
      85         307 :     rList.push_back( new WrappedIgnoreProperty( "LineTransparence", uno::makeAny( sal_Int16(0) ) ) );
      86         307 :     rList.push_back( new WrappedIgnoreProperty( "LineWidth", uno::makeAny( sal_Int32(0) ) ) );
      87         307 :     rList.push_back( new WrappedIgnoreProperty( "LineJoint", uno::makeAny( drawing::LineJoint_ROUND ) ) );
      88         307 : }
      89             : 
      90         307 : void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< WrappedProperty* >& rList )
      91             : {
      92         307 :     addIgnoreFillProperties_without_BitmapProperties( rList );
      93         307 :     addIgnoreFillProperties_only_BitmapProperties( rList );
      94         307 : }
      95             : 
      96         307 : void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
      97             : {
      98         307 :     rList.push_back( new WrappedIgnoreProperty( "FillStyle", uno::makeAny( drawing::FillStyle_SOLID ) ) );
      99         307 :     rList.push_back( new WrappedIgnoreProperty( "FillColor", uno::makeAny( sal_Int32(-1) ) ) );
     100         307 :     rList.push_back( new WrappedIgnoreProperty( "FillTransparence", uno::makeAny( sal_Int16(0) ) ) );
     101         307 :     rList.push_back( new WrappedIgnoreProperty( "FillTransparenceGradientName", uno::makeAny( OUString() ) ) );
     102             : //    rList.push_back( new WrappedIgnoreProperty( "FillTransparenceGradient", uno::makeAny( awt::Gradient() ) ) );
     103         307 :     rList.push_back( new WrappedIgnoreProperty( "FillGradientName", uno::makeAny( OUString() ) ) );
     104             : //    rList.push_back( new WrappedIgnoreProperty( "FillGradient", uno::makeAny( awt::Gradient() ) ) );
     105         307 :     rList.push_back( new WrappedIgnoreProperty( "FillHatchName", uno::makeAny( OUString() ) ) );
     106             : //    rList.push_back( new WrappedIgnoreProperty( "FillHatch", uno::makeAny( drawing::Hatch() ) ) );
     107         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBackground", uno::makeAny( false ) ) );
     108         307 : }
     109             : 
     110         307 : 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         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapOffsetX", uno::makeAny( sal_Int16(0) ) ) );
     116         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapOffsetY", uno::makeAny( sal_Int16(0) ) ) );
     117         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetX", uno::makeAny( sal_Int16(0) ) ) );
     118         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetY", uno::makeAny( sal_Int16(0) ) ) );
     119         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapRectanglePoint", uno::makeAny( drawing::RectanglePoint_LEFT_TOP ) ) );
     120         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapLogicalSize", uno::makeAny( false ) ) );//todo correct default?
     121         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapSizeX", uno::makeAny( sal_Int32(10) ) ) );//todo which default?
     122         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapSizeY", uno::makeAny( sal_Int32(10) ) ) );//todo which default?
     123         307 :     rList.push_back( new WrappedIgnoreProperty( "FillBitmapMode", uno::makeAny( drawing::BitmapMode_REPEAT ) ) );
     124         307 : }
     125             : 
     126             : } //namespace chart
     127             : 
     128             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11