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

Generated by: LCOV version 1.10