diff options
Diffstat (limited to 'chart2/source/model/main/Title.cxx')
-rwxr-xr-x[-rw-r--r--] | chart2/source/model/main/Title.cxx | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx index d7c5691d160d..7081c1b96d36 100644..100755 --- a/chart2/source/model/main/Title.cxx +++ b/chart2/source/model/main/Title.cxx @@ -179,39 +179,34 @@ void lcl_AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE ); } -const uno::Sequence< Property > & lcl_GetPropertySequence() +struct StaticTitleInfoHelper_Initializer { - static uno::Sequence< Property > aPropSeq; + ::cppu::OPropertyArrayHelper* operator()() + { + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; + } - // /-- - MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aPropSeq.getLength() ) +private: + uno::Sequence< Property > lcl_GetPropertySequence() { - // get properties ::std::vector< ::com::sun::star::beans::Property > aProperties; lcl_AddPropertiesToVector( aProperties ); ::chart::LineProperties::AddPropertiesToVector( aProperties ); ::chart::FillProperties::AddPropertiesToVector( aProperties ); - // and sort them for access via bsearch ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - // transfer result to static Sequence - aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return ::chart::ContainerHelper::ContainerToSequence( aProperties ); } - return aPropSeq; -} -::cppu::IPropertyArrayHelper & lcl_getInfoHelper() -{ - static ::cppu::OPropertyArrayHelper aArrayHelper( - lcl_GetPropertySequence(), - /* bSorted = */ sal_True ); +}; - return aArrayHelper; -} +struct StaticTitleInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticTitleInfoHelper_Initializer > +{ +}; } // anonymous namespace @@ -310,7 +305,7 @@ uno::Any Title::GetDefaultValue( sal_Int32 nHandle ) const ::cppu::IPropertyArrayHelper & SAL_CALL Title::getInfoHelper() { - return lcl_getInfoHelper(); + return *StaticTitleInfoHelper::get(); } |