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

Generated by: LCOV version 1.10