LCOV - code coverage report
Current view: top level - xmloff/source/chart - ColorPropertySet.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 47 0.0 %
Date: 2012-08-25 Functions: 0 20 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 32 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include "ColorPropertySet.hxx"
      31                 :            : 
      32                 :            : #include <cppuhelper/implbase1.hxx>
      33                 :            : 
      34                 :            : using namespace ::com::sun::star;
      35                 :            : using namespace ::com::sun::star::beans;
      36                 :            : 
      37                 :            : using ::com::sun::star::uno::Reference;
      38                 :            : using ::com::sun::star::uno::Sequence;
      39                 :            : using ::rtl::OUString;
      40                 :            : using ::com::sun::star::uno::RuntimeException;
      41                 :            : 
      42                 :            : // ================================================================================
      43                 :            : 
      44                 :            : namespace
      45                 :            : {
      46         [ #  # ]:          0 : class lcl_ColorPropertySetInfo : public ::cppu::WeakImplHelper1<
      47                 :            :         XPropertySetInfo  >
      48                 :            : {
      49                 :            : public:
      50                 :            :     lcl_ColorPropertySetInfo( bool bFillColor );
      51                 :            : 
      52                 :            : protected:
      53                 :            :     // ____ XPropertySetInfo ____
      54                 :            :     virtual Sequence< Property > SAL_CALL getProperties()                throw (RuntimeException);
      55                 :            :     virtual Property SAL_CALL getPropertyByName( const OUString& aName ) throw (UnknownPropertyException, RuntimeException);
      56                 :            :     virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name )  throw (RuntimeException);
      57                 :            : 
      58                 :            : private:
      59                 :            :     OUString m_aColorPropName;
      60                 :            :     Property m_aColorProp;
      61                 :            : };
      62                 :            : 
      63                 :          0 : lcl_ColorPropertySetInfo::lcl_ColorPropertySetInfo( bool bFillColor ) :
      64                 :            :         // note: length of FillColor and LineColor is 9
      65                 :            :         m_aColorPropName( (bFillColor ? "FillColor" : "LineColor"), 9, RTL_TEXTENCODING_ASCII_US ),
      66                 :            :         m_aColorProp( m_aColorPropName, -1,
      67 [ #  # ][ #  # ]:          0 :                       ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), 0)
                 [ #  # ]
      68                 :          0 : {}
      69                 :            : 
      70                 :          0 : Sequence< Property > SAL_CALL lcl_ColorPropertySetInfo::getProperties()
      71                 :            :     throw (RuntimeException)
      72                 :            : {
      73                 :            : 
      74                 :          0 :     return Sequence< Property >( & m_aColorProp, 1 );
      75                 :            : }
      76                 :            : 
      77                 :          0 : Property SAL_CALL lcl_ColorPropertySetInfo::getPropertyByName( const OUString& aName )
      78                 :            :     throw (UnknownPropertyException, RuntimeException)
      79                 :            : {
      80         [ #  # ]:          0 :     if( aName.equals( m_aColorPropName ))
      81                 :          0 :         return m_aColorProp;
      82 [ #  # ][ #  # ]:          0 :     throw UnknownPropertyException( m_aColorPropName, static_cast< uno::XWeak * >( this ));
      83                 :            : }
      84                 :            : 
      85                 :          0 : sal_Bool SAL_CALL lcl_ColorPropertySetInfo::hasPropertyByName( const OUString& Name )
      86                 :            :     throw (RuntimeException)
      87                 :            : {
      88                 :          0 :     return Name.equals( m_aColorPropName );
      89                 :            : }
      90                 :            : 
      91                 :            : } // anonymous namespace
      92                 :            : 
      93                 :            : // ================================================================================
      94                 :            : 
      95                 :            : namespace xmloff
      96                 :            : {
      97                 :            : namespace chart
      98                 :            : {
      99                 :            : 
     100                 :          0 : ColorPropertySet::ColorPropertySet( sal_Int32 nColor, bool bFillColor /* = true */ ) :
     101                 :            :         // note: length of FillColor and LineColor is 9
     102                 :            :         m_aColorPropName( (bFillColor ? "FillColor" : "LineColor"), 9, RTL_TEXTENCODING_ASCII_US ),
     103                 :            :         m_nColor( nColor ),
     104                 :            :         m_bIsFillColor( bFillColor ),
     105 [ #  # ][ #  # ]:          0 :         m_nDefaultColor( 0x0099ccff )  // blue 8
     106                 :          0 : {}
     107                 :            : 
     108                 :          0 : ColorPropertySet::~ColorPropertySet()
     109         [ #  # ]:          0 : {}
     110                 :            : 
     111                 :            : // ____ XPropertySet ____
     112                 :            : 
     113                 :          0 : Reference< XPropertySetInfo > SAL_CALL ColorPropertySet::getPropertySetInfo()
     114                 :            :     throw (uno::RuntimeException)
     115                 :            : {
     116         [ #  # ]:          0 :     if( ! m_xInfo.is())
     117 [ #  # ][ #  # ]:          0 :         m_xInfo.set( new lcl_ColorPropertySetInfo( m_bIsFillColor ));
     118                 :            : 
     119                 :          0 :     return m_xInfo;
     120                 :            : }
     121                 :            : 
     122                 :          0 : void SAL_CALL ColorPropertySet::setPropertyValue( const OUString& /* aPropertyName */, const uno::Any& aValue )
     123                 :            :     throw (UnknownPropertyException,
     124                 :            :            PropertyVetoException,
     125                 :            :            lang::IllegalArgumentException,
     126                 :            :            lang::WrappedTargetException,
     127                 :            :            uno::RuntimeException)
     128                 :            : {
     129                 :          0 :     aValue >>= m_nColor;
     130                 :          0 : }
     131                 :            : 
     132                 :          0 : uno::Any SAL_CALL ColorPropertySet::getPropertyValue( const OUString& /* PropertyName */ )
     133                 :            :     throw (UnknownPropertyException,
     134                 :            :            lang::WrappedTargetException,
     135                 :            :            uno::RuntimeException)
     136                 :            : {
     137                 :          0 :     return uno::makeAny( m_nColor );
     138                 :            : }
     139                 :            : 
     140                 :          0 : void SAL_CALL ColorPropertySet::addPropertyChangeListener( const OUString& /* aPropertyName */, const Reference< XPropertyChangeListener >& /* xListener */ )
     141                 :            :     throw (UnknownPropertyException,
     142                 :            :            lang::WrappedTargetException,
     143                 :            :            uno::RuntimeException)
     144                 :            : {
     145                 :            :     OSL_FAIL( "Not Implemented" );
     146                 :          0 :     return;
     147                 :            : }
     148                 :            : 
     149                 :          0 : void SAL_CALL ColorPropertySet::removePropertyChangeListener( const OUString& /* aPropertyName */, const Reference< XPropertyChangeListener >& /* aListener */ )
     150                 :            :     throw (UnknownPropertyException,
     151                 :            :            lang::WrappedTargetException,
     152                 :            :            uno::RuntimeException)
     153                 :            : {
     154                 :            :     OSL_FAIL( "Not Implemented" );
     155                 :          0 :     return;
     156                 :            : }
     157                 :            : 
     158                 :          0 : void SAL_CALL ColorPropertySet::addVetoableChangeListener( const OUString& /* PropertyName */, const Reference< XVetoableChangeListener >& /* aListener */ )
     159                 :            :     throw (UnknownPropertyException,
     160                 :            :            lang::WrappedTargetException,
     161                 :            :            uno::RuntimeException)
     162                 :            : {
     163                 :            :     OSL_FAIL( "Not Implemented" );
     164                 :          0 :     return;
     165                 :            : }
     166                 :            : 
     167                 :          0 : void SAL_CALL ColorPropertySet::removeVetoableChangeListener( const OUString& /* PropertyName */, const Reference< XVetoableChangeListener >& /* aListener */ )
     168                 :            :     throw (UnknownPropertyException,
     169                 :            :            lang::WrappedTargetException,
     170                 :            :            uno::RuntimeException)
     171                 :            : {
     172                 :            :     OSL_FAIL( "Not Implemented" );
     173                 :          0 :     return;
     174                 :            : }
     175                 :            : 
     176                 :            : // ____ XPropertyState ____
     177                 :            : 
     178                 :          0 : PropertyState SAL_CALL ColorPropertySet::getPropertyState( const OUString& /* PropertyName */ )
     179                 :            :     throw (UnknownPropertyException,
     180                 :            :            uno::RuntimeException)
     181                 :            : {
     182                 :          0 :     return PropertyState_DIRECT_VALUE;
     183                 :            : }
     184                 :            : 
     185                 :          0 : Sequence< PropertyState > SAL_CALL ColorPropertySet::getPropertyStates( const Sequence< OUString >& /* aPropertyName */ )
     186                 :            :     throw (UnknownPropertyException,
     187                 :            :            uno::RuntimeException)
     188                 :            : {
     189                 :          0 :     PropertyState aState = PropertyState_DIRECT_VALUE;
     190         [ #  # ]:          0 :     return Sequence< PropertyState >( & aState, 1 );
     191                 :            : }
     192                 :            : 
     193                 :          0 : void SAL_CALL ColorPropertySet::setPropertyToDefault( const OUString& PropertyName )
     194                 :            :     throw (UnknownPropertyException,
     195                 :            :            uno::RuntimeException)
     196                 :            : {
     197         [ #  # ]:          0 :     if( PropertyName.equals( m_aColorPropName ))
     198                 :          0 :         m_nColor = m_nDefaultColor;
     199                 :          0 : }
     200                 :            : 
     201                 :          0 : uno::Any SAL_CALL ColorPropertySet::getPropertyDefault( const OUString& aPropertyName )
     202                 :            :     throw (UnknownPropertyException,
     203                 :            :            lang::WrappedTargetException,
     204                 :            :            uno::RuntimeException)
     205                 :            : {
     206         [ #  # ]:          0 :     if( aPropertyName.equals( m_aColorPropName ))
     207                 :          0 :         return uno::makeAny( m_nDefaultColor );
     208                 :          0 :     return uno::Any();
     209                 :            : }
     210                 :            : 
     211                 :            : } //  namespace chart
     212                 :            : } //  namespace xmloff
     213                 :            : 
     214                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10