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