LCOV - code coverage report
Current view: top level - chart2/source/controller/chartapiwrapper - TitleWrapper.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 228 0.0 %
Date: 2014-04-14 Functions: 0 47 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 "TitleWrapper.hxx"
      21             : #include "macros.hxx"
      22             : #include "ContainerHelper.hxx"
      23             : #include "ControllerLockGuard.hxx"
      24             : 
      25             : #include <comphelper/InlineContainer.hxx>
      26             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      27             : #include <com/sun/star/chart2/RelativePosition.hpp>
      28             : 
      29             : #include "CharacterProperties.hxx"
      30             : #include "LinePropertiesHelper.hxx"
      31             : #include "FillProperties.hxx"
      32             : #include "UserDefinedProperties.hxx"
      33             : #include "WrappedCharacterHeightProperty.hxx"
      34             : #include "WrappedTextRotationProperty.hxx"
      35             : #include "WrappedAutomaticPositionProperties.hxx"
      36             : #include "WrappedScaleTextProperties.hxx"
      37             : 
      38             : #include <algorithm>
      39             : #include <rtl/ustrbuf.hxx>
      40             : 
      41             : using namespace ::com::sun::star;
      42             : using ::com::sun::star::beans::Property;
      43             : using ::osl::MutexGuard;
      44             : using ::com::sun::star::uno::Any;
      45             : using ::com::sun::star::uno::Reference;
      46             : using ::com::sun::star::uno::Sequence;
      47             : 
      48             : namespace chart
      49             : {
      50             : class WrappedTitleStringProperty : public WrappedProperty
      51             : {
      52             : public:
      53             :     WrappedTitleStringProperty( const Reference< uno::XComponentContext >& xContext );
      54             :     virtual ~WrappedTitleStringProperty();
      55             : 
      56             :     virtual void setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
      57             :                                     throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) SAL_OVERRIDE;
      58             :     virtual Any getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
      59             :                                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) SAL_OVERRIDE;
      60             :     virtual Any getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
      61             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) SAL_OVERRIDE;
      62             : 
      63             : protected:
      64             :     Reference< uno::XComponentContext > m_xContext;
      65             : };
      66             : 
      67           0 : WrappedTitleStringProperty::WrappedTitleStringProperty( const Reference< uno::XComponentContext >& xContext )
      68             :     : ::chart::WrappedProperty( "String", OUString() )
      69           0 :     , m_xContext( xContext )
      70             : {
      71           0 : }
      72           0 : WrappedTitleStringProperty::~WrappedTitleStringProperty()
      73             : {
      74           0 : }
      75             : 
      76           0 : void WrappedTitleStringProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
      77             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      78             : {
      79           0 :     Reference< chart2::XTitle > xTitle(xInnerPropertySet,uno::UNO_QUERY);
      80           0 :     if(xTitle.is())
      81             :     {
      82           0 :         OUString aString;
      83           0 :         rOuterValue >>= aString;
      84           0 :         TitleHelper::setCompleteString( aString, xTitle, m_xContext );
      85           0 :     }
      86           0 : }
      87           0 : Any WrappedTitleStringProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
      88             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      89             : {
      90           0 :     Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
      91           0 :     Reference< chart2::XTitle > xTitle(xInnerPropertySet,uno::UNO_QUERY);
      92           0 :     if(xTitle.is())
      93             :     {
      94           0 :         Sequence< Reference< chart2::XFormattedString > > aStrings( xTitle->getText());
      95             : 
      96           0 :         OUStringBuffer aBuf;
      97           0 :         for( sal_Int32 i = 0; i < aStrings.getLength(); ++i )
      98             :         {
      99           0 :             aBuf.append( aStrings[ i ]->getString());
     100             :         }
     101           0 :         aRet <<= aBuf.makeStringAndClear();
     102             :     }
     103           0 :     return aRet;
     104             : }
     105           0 : Any WrappedTitleStringProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
     106             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     107             : {
     108           0 :     return uno::makeAny( OUString() );//default title is a empty String
     109             : }
     110             : 
     111             : class WrappedStackedTextProperty : public WrappedProperty
     112             : {
     113             : public:
     114             :     WrappedStackedTextProperty();
     115             :     virtual ~WrappedStackedTextProperty();
     116             : };
     117             : 
     118           0 : WrappedStackedTextProperty::WrappedStackedTextProperty()
     119           0 :     : ::chart::WrappedProperty( "StackedText", "StackCharacters" )
     120             : {
     121           0 : }
     122           0 : WrappedStackedTextProperty::~WrappedStackedTextProperty()
     123             : {
     124           0 : }
     125             : 
     126             : }// end namespace chart
     127             : 
     128             : namespace
     129             : {
     130           0 : static const OUString lcl_aServiceName("com.sun.star.comp.chart.Title");
     131             : 
     132             : enum
     133             : {
     134             :     PROP_TITLE_STRING,
     135             :     PROP_TITLE_TEXT_ROTATION,
     136             :     PROP_TITLE_TEXT_STACKED
     137             : };
     138             : 
     139           0 : void lcl_AddPropertiesToVector(
     140             :     ::std::vector< Property > & rOutProperties )
     141             : {
     142             :     rOutProperties.push_back(
     143             :         Property( "String",
     144             :                   PROP_TITLE_STRING,
     145           0 :                   ::getCppuType( reinterpret_cast< const OUString * >(0)),
     146             :                   beans::PropertyAttribute::BOUND
     147           0 :                   | beans::PropertyAttribute::MAYBEVOID ));
     148             : 
     149             :     rOutProperties.push_back(
     150             :         Property( "TextRotation",
     151             :                   PROP_TITLE_TEXT_ROTATION,
     152           0 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
     153             :                   beans::PropertyAttribute::BOUND
     154           0 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     155             :     rOutProperties.push_back(
     156             :         Property( "StackedText",
     157             :                   PROP_TITLE_TEXT_STACKED,
     158           0 :                   ::getBooleanCppuType(),
     159             :                   beans::PropertyAttribute::BOUND
     160           0 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     161           0 : }
     162             : 
     163             : struct StaticTitleWrapperPropertyArray_Initializer
     164             : {
     165           0 :     Sequence< Property >* operator()()
     166             :     {
     167           0 :         static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
     168           0 :         return &aPropSeq;
     169             :     }
     170             : 
     171             : private:
     172           0 :     Sequence< Property > lcl_GetPropertySequence()
     173             :     {
     174           0 :         ::std::vector< beans::Property > aProperties;
     175           0 :         lcl_AddPropertiesToVector( aProperties );
     176           0 :         ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
     177           0 :         ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
     178           0 :         ::chart::FillProperties::AddPropertiesToVector( aProperties );
     179           0 :         ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
     180           0 :         ::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
     181           0 :         ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
     182             : 
     183             :         ::std::sort( aProperties.begin(), aProperties.end(),
     184           0 :                      ::chart::PropertyNameLess() );
     185             : 
     186           0 :         return ::chart::ContainerHelper::ContainerToSequence( aProperties );
     187             :     }
     188             : };
     189             : 
     190             : struct StaticTitleWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticTitleWrapperPropertyArray_Initializer >
     191             : {
     192             : };
     193             : 
     194             : } // anonymous namespace
     195             : 
     196             : namespace chart
     197             : {
     198             : namespace wrapper
     199             : {
     200             : 
     201           0 : TitleWrapper::TitleWrapper( ::chart::TitleHelper::eTitleType eTitleType,
     202             :     ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ) :
     203             :         m_spChart2ModelContact( spChart2ModelContact ),
     204             :         m_aEventListenerContainer( m_aMutex ),
     205           0 :         m_eTitleType(eTitleType)
     206             : {
     207           0 :     ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
     208           0 :     if( !getTitleObject().is() ) //#i83831# create an empty title at the model, thus references to properties can be mapped mapped correctly
     209           0 :         TitleHelper::createTitle( m_eTitleType, OUString(), m_spChart2ModelContact->getChartModel(), m_spChart2ModelContact->m_xContext );
     210           0 : }
     211             : 
     212           0 : TitleWrapper::~TitleWrapper()
     213             : {
     214           0 : }
     215             : 
     216             : // ____ XShape ____
     217           0 : awt::Point SAL_CALL TitleWrapper::getPosition()
     218             :     throw (uno::RuntimeException, std::exception)
     219             : {
     220           0 :     return m_spChart2ModelContact->GetTitlePosition( this->getTitleObject() );
     221             : }
     222             : 
     223           0 : void SAL_CALL TitleWrapper::setPosition( const awt::Point& aPosition )
     224             :     throw (uno::RuntimeException, std::exception)
     225             : {
     226           0 :     Reference< beans::XPropertySet > xPropertySet( this->getInnerPropertySet() );
     227           0 :     if(xPropertySet.is())
     228             :     {
     229           0 :         awt::Size aPageSize( m_spChart2ModelContact->GetPageSize() );
     230             : 
     231           0 :         chart2::RelativePosition aRelativePosition;
     232           0 :         aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
     233           0 :         aRelativePosition.Primary = double(aPosition.X)/double(aPageSize.Width);
     234           0 :         aRelativePosition.Secondary = double(aPosition.Y)/double(aPageSize.Height);
     235           0 :         xPropertySet->setPropertyValue( "RelativePosition", uno::makeAny(aRelativePosition) );
     236           0 :     }
     237           0 : }
     238             : 
     239           0 : awt::Size SAL_CALL TitleWrapper::getSize()
     240             :     throw (uno::RuntimeException, std::exception)
     241             : {
     242           0 :     return m_spChart2ModelContact->GetTitleSize( this->getTitleObject() );
     243             : }
     244             : 
     245           0 : void SAL_CALL TitleWrapper::setSize( const awt::Size& /*aSize*/ )
     246             :     throw (beans::PropertyVetoException,
     247             :            uno::RuntimeException, std::exception)
     248             : {
     249             :     OSL_FAIL( "trying to set size of title" );
     250           0 : }
     251             : 
     252             : // ____ XShapeDescriptor (base of XShape) ____
     253           0 : OUString SAL_CALL TitleWrapper::getShapeType()
     254             :     throw (uno::RuntimeException, std::exception)
     255             : {
     256           0 :     return OUString( "com.sun.star.chart.ChartTitle" );
     257             : }
     258             : 
     259             : // ____ XComponent ____
     260           0 : void SAL_CALL TitleWrapper::dispose()
     261             :     throw (uno::RuntimeException, std::exception)
     262             : {
     263           0 :     Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
     264           0 :     m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
     265             : 
     266           0 :     MutexGuard aGuard( GetMutex());
     267           0 :     clearWrappedPropertySet();
     268           0 : }
     269             : 
     270           0 : void SAL_CALL TitleWrapper::addEventListener(
     271             :     const Reference< lang::XEventListener >& xListener )
     272             :     throw (uno::RuntimeException, std::exception)
     273             : {
     274           0 :     m_aEventListenerContainer.addInterface( xListener );
     275           0 : }
     276             : 
     277           0 : void SAL_CALL TitleWrapper::removeEventListener(
     278             :     const Reference< lang::XEventListener >& aListener )
     279             :     throw (uno::RuntimeException, std::exception)
     280             : {
     281           0 :     m_aEventListenerContainer.removeInterface( aListener );
     282           0 : }
     283             : 
     284           0 : Reference< beans::XPropertySet > TitleWrapper::getFirstCharacterPropertySet()
     285             : {
     286           0 :     Reference< beans::XPropertySet > xProp;
     287             : 
     288           0 :     Reference< chart2::XTitle > xTitle( this->getTitleObject() );
     289           0 :     if( xTitle.is())
     290             :     {
     291           0 :         Sequence< Reference< chart2::XFormattedString > > aStrings( xTitle->getText());
     292           0 :         if( aStrings.getLength() > 0 )
     293           0 :             xProp.set( aStrings[0], uno::UNO_QUERY );
     294             :     }
     295             : 
     296           0 :     return xProp;
     297             : }
     298             : 
     299           0 : void TitleWrapper::getFastCharacterPropertyValue( sal_Int32 nHandle, Any& rValue )
     300             : {
     301             :     OSL_ASSERT( FAST_PROPERTY_ID_START_CHAR_PROP <= nHandle &&
     302             :                 nHandle < CharacterProperties::FAST_PROPERTY_ID_END_CHAR_PROP );
     303             : 
     304           0 :     Reference< beans::XPropertySet > xProp( getFirstCharacterPropertySet(), uno::UNO_QUERY );
     305           0 :     Reference< beans::XFastPropertySet > xFastProp( xProp, uno::UNO_QUERY );
     306           0 :     if(xProp.is())
     307             :     {
     308           0 :         const WrappedProperty* pWrappedProperty = getWrappedProperty( nHandle );
     309           0 :         if( pWrappedProperty )
     310             :         {
     311           0 :             rValue = pWrappedProperty->getPropertyValue( xProp );
     312             :         }
     313           0 :         else if( xFastProp.is() )
     314             :         {
     315           0 :             rValue = xFastProp->getFastPropertyValue( nHandle );
     316             :         }
     317           0 :     }
     318             : 
     319           0 : }
     320             : 
     321           0 : void TitleWrapper::setFastCharacterPropertyValue(
     322             :     sal_Int32 nHandle, const Any& rValue ) throw (uno::Exception)
     323             : {
     324             :     OSL_ASSERT( FAST_PROPERTY_ID_START_CHAR_PROP <= nHandle &&
     325             :                 nHandle < CharacterProperties::FAST_PROPERTY_ID_END_CHAR_PROP );
     326             : 
     327           0 :     Reference< chart2::XTitle > xTitle( this->getTitleObject() );
     328           0 :     if( xTitle.is())
     329             :     {
     330           0 :         Sequence< Reference< chart2::XFormattedString > > aStrings( xTitle->getText());
     331           0 :         const WrappedProperty* pWrappedProperty = getWrappedProperty( nHandle );
     332             : 
     333           0 :         for( sal_Int32 i = 0; i < aStrings.getLength(); ++i )
     334             :         {
     335           0 :             Reference< beans::XFastPropertySet > xFastPropertySet( aStrings[ i ], uno::UNO_QUERY );
     336           0 :             Reference< beans::XPropertySet > xPropSet( xFastPropertySet, uno::UNO_QUERY );
     337             : 
     338           0 :             if( pWrappedProperty )
     339           0 :                 pWrappedProperty->setPropertyValue( rValue, xPropSet );
     340           0 :             else if( xFastPropertySet.is() )
     341           0 :                 xFastPropertySet->setFastPropertyValue( nHandle, rValue );
     342           0 :         }
     343           0 :     }
     344           0 : }
     345             : 
     346             : // WrappedPropertySet
     347             : 
     348           0 : void SAL_CALL TitleWrapper::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
     349             :                                     throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     350             : {
     351           0 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     352           0 :     if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
     353             :     {
     354           0 :         setFastCharacterPropertyValue( nHandle, rValue );
     355             :     }
     356             :     else
     357           0 :         WrappedPropertySet::setPropertyValue( rPropertyName, rValue );
     358           0 : }
     359             : 
     360           0 : Any SAL_CALL TitleWrapper::getPropertyValue( const OUString& rPropertyName )
     361             :                                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     362             : {
     363           0 :     Any aRet;
     364           0 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     365           0 :     if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
     366           0 :         getFastCharacterPropertyValue( nHandle, aRet );
     367             :     else
     368           0 :         aRet = WrappedPropertySet::getPropertyValue( rPropertyName );
     369           0 :     return aRet;
     370             : }
     371             : 
     372           0 : beans::PropertyState SAL_CALL TitleWrapper::getPropertyState( const OUString& rPropertyName )
     373             :                                     throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     374             : {
     375           0 :     beans::PropertyState aState( beans::PropertyState_DIRECT_VALUE );
     376             : 
     377           0 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     378           0 :     if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
     379             :     {
     380           0 :         Reference< beans::XPropertyState > xPropState( getFirstCharacterPropertySet(), uno::UNO_QUERY );
     381           0 :         if( xPropState.is() )
     382             :         {
     383           0 :             const WrappedProperty* pWrappedProperty = getWrappedProperty( rPropertyName );
     384           0 :             if( pWrappedProperty )
     385           0 :                 aState = pWrappedProperty->getPropertyState( xPropState );
     386             :             else
     387           0 :                 aState = xPropState->getPropertyState( rPropertyName );
     388           0 :         }
     389             :     }
     390             :     else
     391           0 :         aState = WrappedPropertySet::getPropertyState( rPropertyName );
     392             : 
     393           0 :     return aState;
     394             : }
     395           0 : void SAL_CALL TitleWrapper::setPropertyToDefault( const OUString& rPropertyName )
     396             :                                     throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     397             : {
     398           0 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     399           0 :     if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
     400             :     {
     401           0 :         Any aDefault = getPropertyDefault( rPropertyName );
     402           0 :         setFastCharacterPropertyValue( nHandle, aDefault );
     403             :     }
     404             :     else
     405           0 :         WrappedPropertySet::setPropertyToDefault( rPropertyName );
     406           0 : }
     407           0 : Any SAL_CALL TitleWrapper::getPropertyDefault( const OUString& rPropertyName )
     408             :                                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     409             : {
     410           0 :     Any aRet;
     411             : 
     412           0 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     413           0 :     if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
     414             :     {
     415           0 :         Reference< beans::XPropertyState > xPropState( getFirstCharacterPropertySet(), uno::UNO_QUERY );
     416           0 :         if( xPropState.is() )
     417             :         {
     418           0 :             const WrappedProperty* pWrappedProperty = getWrappedProperty( rPropertyName );
     419           0 :             if( pWrappedProperty )
     420           0 :                 aRet = pWrappedProperty->getPropertyDefault(xPropState);
     421             :             else
     422           0 :                 aRet = xPropState->getPropertyDefault( rPropertyName );
     423           0 :         }
     424             :     }
     425             :     else
     426           0 :         aRet = WrappedPropertySet::getPropertyDefault( rPropertyName );
     427             : 
     428           0 :     return aRet;
     429             : }
     430             : 
     431           0 : void SAL_CALL TitleWrapper::addPropertyChangeListener( const OUString& rPropertyName, const Reference< beans::XPropertyChangeListener >& xListener )
     432             :                                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     433             : {
     434           0 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     435           0 :     if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
     436             :     {
     437           0 :         Reference< beans::XPropertySet > xPropSet( getFirstCharacterPropertySet(), uno::UNO_QUERY );
     438           0 :         if( xPropSet.is() )
     439           0 :             xPropSet->addPropertyChangeListener( rPropertyName, xListener );
     440             :     }
     441             :     else
     442           0 :         WrappedPropertySet::addPropertyChangeListener( rPropertyName, xListener );
     443           0 : }
     444           0 : void SAL_CALL TitleWrapper::removePropertyChangeListener( const OUString& rPropertyName, const Reference< beans::XPropertyChangeListener >& xListener )
     445             :                                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     446             : {
     447           0 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     448           0 :     if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
     449             :     {
     450           0 :         Reference< beans::XPropertySet > xPropSet( getFirstCharacterPropertySet(), uno::UNO_QUERY );
     451           0 :         if( xPropSet.is() )
     452           0 :             xPropSet->removePropertyChangeListener( rPropertyName, xListener );
     453             :     }
     454             :     else
     455           0 :         WrappedPropertySet::removePropertyChangeListener( rPropertyName, xListener );
     456           0 : }
     457             : 
     458             : //ReferenceSizePropertyProvider
     459           0 : void TitleWrapper::updateReferenceSize()
     460             : {
     461           0 :     Reference< beans::XPropertySet > xProp( this->getTitleObject(), uno::UNO_QUERY );
     462           0 :     if( xProp.is() )
     463             :     {
     464           0 :         if( xProp->getPropertyValue( "ReferencePageSize" ).hasValue() )
     465           0 :             xProp->setPropertyValue( "ReferencePageSize", uno::makeAny(
     466           0 :                             m_spChart2ModelContact->GetPageSize() ));
     467           0 :     }
     468           0 : }
     469           0 : Any TitleWrapper::getReferenceSize()
     470             : {
     471           0 :     Any aRet;
     472           0 :     Reference< beans::XPropertySet > xProp( this->getTitleObject(), uno::UNO_QUERY );
     473           0 :     if( xProp.is() )
     474           0 :         aRet = xProp->getPropertyValue( "ReferencePageSize" );
     475             : 
     476           0 :     return aRet;
     477             : }
     478           0 : awt::Size TitleWrapper::getCurrentSizeForReference()
     479             : {
     480           0 :     return m_spChart2ModelContact->GetPageSize();
     481             : }
     482             : 
     483           0 : Reference< chart2::XTitle > TitleWrapper::getTitleObject()
     484             : {
     485           0 :     return TitleHelper::getTitle( m_eTitleType, m_spChart2ModelContact->getChartModel() );
     486             : }
     487             : 
     488             : // WrappedPropertySet
     489             : 
     490           0 : Reference< beans::XPropertySet > TitleWrapper::getInnerPropertySet()
     491             : {
     492           0 :     return Reference< beans::XPropertySet >( this->getTitleObject(), uno::UNO_QUERY );
     493             : }
     494             : 
     495           0 : const Sequence< beans::Property >& TitleWrapper::getPropertySequence()
     496             : {
     497           0 :     return *StaticTitleWrapperPropertyArray::get();
     498             : }
     499             : 
     500           0 : const std::vector< WrappedProperty* > TitleWrapper::createWrappedProperties()
     501             : {
     502           0 :     ::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
     503             : 
     504           0 :     aWrappedProperties.push_back( new WrappedTitleStringProperty( m_spChart2ModelContact->m_xContext ) );
     505           0 :     aWrappedProperties.push_back( new WrappedTextRotationProperty( m_eTitleType==TitleHelper::Y_AXIS_TITLE || m_eTitleType==TitleHelper::X_AXIS_TITLE ) );
     506           0 :     aWrappedProperties.push_back( new WrappedStackedTextProperty() );
     507           0 :     WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
     508           0 :     WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
     509           0 :     WrappedScaleTextProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
     510             : 
     511           0 :     return aWrappedProperties;
     512             : }
     513             : 
     514           0 : Sequence< OUString > TitleWrapper::getSupportedServiceNames_Static()
     515             : {
     516           0 :     Sequence< OUString > aServices( 4 );
     517           0 :     aServices[ 0 ] = "com.sun.star.chart.ChartTitle";
     518           0 :     aServices[ 1 ] = "com.sun.star.drawing.Shape";
     519           0 :     aServices[ 2 ] = "com.sun.star.xml.UserDefinedAttributesSupplier";
     520           0 :     aServices[ 3 ] = "com.sun.star.style.CharacterProperties";
     521             : 
     522           0 :     return aServices;
     523             : }
     524             : 
     525             : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
     526           0 : APPHELPER_XSERVICEINFO_IMPL( TitleWrapper, lcl_aServiceName );
     527             : 
     528             : } //  namespace wrapper
     529           0 : } //  namespace chart
     530             : 
     531             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10