LCOV - code coverage report
Current view: top level - chart2/source/tools - WrappedIgnoreProperty.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 45 50 90.0 %
Date: 2012-08-25 Functions: 10 12 83.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 91 182 50.0 %

           Branch data     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                 :            : using ::rtl::OUString;
      36                 :            : 
      37                 :            : //.............................................................................
      38                 :            : namespace chart
      39                 :            : {
      40                 :            : //.............................................................................
      41                 :            : 
      42                 :            : 
      43                 :        992 : WrappedIgnoreProperty::WrappedIgnoreProperty( const OUString& rOuterName, const Any& rDefaultValue )
      44                 :            :                          : WrappedProperty( rOuterName, OUString() )
      45                 :            :                          , m_aDefaultValue( rDefaultValue )
      46         [ +  - ]:        992 :                          , m_aCurrentValue( rDefaultValue )
      47                 :            : {
      48                 :        992 : }
      49                 :        992 : WrappedIgnoreProperty::~WrappedIgnoreProperty()
      50                 :            : {
      51         [ -  + ]:       1982 : }
      52                 :            : 
      53                 :          8 : void WrappedIgnoreProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
      54                 :            :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      55                 :            : {
      56                 :          8 :     m_aCurrentValue = rOuterValue;
      57                 :          8 : }
      58                 :            : 
      59                 :      11221 : Any WrappedIgnoreProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
      60                 :            :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      61                 :            : {
      62                 :      11221 :     return m_aCurrentValue;
      63                 :            : }
      64                 :            : 
      65                 :          0 : void WrappedIgnoreProperty::setPropertyToDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
      66                 :            :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
      67                 :            : {
      68                 :          0 :     m_aCurrentValue = m_aDefaultValue;
      69                 :          0 : }
      70                 :            : 
      71                 :          0 : Any WrappedIgnoreProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
      72                 :            :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      73                 :            : {
      74                 :          0 :     return m_aDefaultValue;
      75                 :            : }
      76                 :            : 
      77                 :        470 : beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
      78                 :            :                         throw (beans::UnknownPropertyException, uno::RuntimeException)
      79                 :            : {
      80                 :        470 :     return ( m_aCurrentValue == m_aDefaultValue
      81                 :            :              ? beans::PropertyState_DEFAULT_VALUE
      82         [ +  - ]:        470 :              : beans::PropertyState_DIRECT_VALUE );
      83                 :            : }
      84                 :            : 
      85                 :         33 : void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< WrappedProperty* >& rList )
      86                 :            : {
      87 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID ) ) );
         [ +  - ][ +  - ]
      88 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "LineDashName" ), uno::makeAny( rtl::OUString() ) ) );
         [ +  - ][ +  - ]
      89 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "LineColor" ), uno::makeAny( sal_Int32(0) ) ) );
         [ +  - ][ +  - ]
      90 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "LineTransparence" ), uno::makeAny( sal_Int16(0) ) ) );
         [ +  - ][ +  - ]
      91 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "LineWidth" ), uno::makeAny( sal_Int32(0) ) ) );
         [ +  - ][ +  - ]
      92 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "LineJoint" ), uno::makeAny( drawing::LineJoint_ROUND ) ) );
         [ +  - ][ +  - ]
      93                 :         33 : }
      94                 :            : 
      95                 :         33 : void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< WrappedProperty* >& rList )
      96                 :            : {
      97                 :         33 :     addIgnoreFillProperties_without_BitmapProperties( rList );
      98                 :         33 :     addIgnoreFillProperties_only_BitmapProperties( rList );
      99                 :         33 : }
     100                 :            : 
     101                 :         33 : void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
     102                 :            : {
     103 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillStyle" ), uno::makeAny( drawing::FillStyle_SOLID ) ) );
         [ +  - ][ +  - ]
     104 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillColor" ), uno::makeAny( sal_Int32(-1) ) ) );
         [ +  - ][ +  - ]
     105 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparence" ), uno::makeAny( sal_Int16(0) ) ) );
         [ +  - ][ +  - ]
     106 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparenceGradientName" ), uno::makeAny( ::rtl::OUString() ) ) );
         [ +  - ][ +  - ]
     107                 :            : //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparenceGradient" ), uno::makeAny( awt::Gradient() ) ) );
     108 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillGradientName" ), uno::makeAny( ::rtl::OUString() ) ) );
         [ +  - ][ +  - ]
     109                 :            : //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillGradient" ), uno::makeAny( awt::Gradient() ) ) );
     110 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillHatchName" ), uno::makeAny( ::rtl::OUString() ) ) );
         [ +  - ][ +  - ]
     111                 :            : //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillHatch" ), uno::makeAny( drawing::Hatch() ) ) );
     112 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBackground" ), uno::makeAny( sal_Bool(sal_False) ) ) );
         [ +  - ][ +  - ]
     113                 :         33 : }
     114                 :            : 
     115                 :         33 : void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
     116                 :            : {
     117                 :            : //     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapName" ), uno::makeAny( ::rtl::OUString() ) ) );
     118                 :            : //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmap" ), uno::makeAny( uno::Reference< awt::XBitmap > (0) ) ) );
     119                 :            : //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapURL" ), uno::makeAny( ::rtl::OUString() ) ) );
     120 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapOffsetX" ), uno::makeAny( sal_Int16(0) ) ) );
         [ +  - ][ +  - ]
     121 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapOffsetY" ), uno::makeAny( sal_Int16(0) ) ) );
         [ +  - ][ +  - ]
     122 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapPositionOffsetX" ), uno::makeAny( sal_Int16(0) ) ) );
         [ +  - ][ +  - ]
     123 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapPositionOffsetY" ), uno::makeAny( sal_Int16(0) ) ) );
         [ +  - ][ +  - ]
     124 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapRectanglePoint" ), uno::makeAny( drawing::RectanglePoint_LEFT_TOP ) ) );
         [ +  - ][ +  - ]
     125 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapLogicalSize" ), uno::makeAny( sal_Bool(sal_False) ) ) );//todo correct default?
         [ +  - ][ +  - ]
     126 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapSizeX" ), uno::makeAny( sal_Int32(10) ) ) );//todo which default?
         [ +  - ][ +  - ]
     127 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapSizeY" ), uno::makeAny( sal_Int32(10) ) ) );//todo which default?
         [ +  - ][ +  - ]
     128 [ +  - ][ +  - ]:         33 :     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapMode" ), uno::makeAny( drawing::BitmapMode_REPEAT ) ) );
         [ +  - ][ +  - ]
     129                 :         33 : }
     130                 :            : 
     131                 :            : //.............................................................................
     132                 :            : } //namespace chart
     133                 :            : //.............................................................................
     134                 :            : 
     135                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10