diff options
Diffstat (limited to 'chart2/source/model/main/Diagram.cxx')
-rwxr-xr-x[-rw-r--r--] | chart2/source/model/main/Diagram.cxx | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index ff8a0c4030bc..4f86fc9fac51 100644..100755 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -41,6 +41,7 @@ #include "DisposeHelper.hxx" #include "BaseGFXHelper.hxx" #include <basegfx/numeric/ftools.hxx> +#include <rtl/instance.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/chart2/RelativePosition.hpp> #include <com/sun/star/chart2/RelativeSize.hpp> @@ -188,30 +189,34 @@ void lcl_AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 ); } -const Sequence< Property > & lcl_GetPropertySequence() +struct StaticDiagramInfoHelper_Initializer { - static Sequence< Property > aPropSeq; + ::cppu::OPropertyArrayHelper* operator()() + { + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; + } - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aPropSeq.getLength() ) +private: + Sequence< Property > lcl_GetPropertySequence() { - // get properties ::std::vector< ::com::sun::star::beans::Property > aProperties; lcl_AddPropertiesToVector( aProperties ); ::chart::SceneProperties::AddPropertiesToVector( aProperties ); ::chart::UserDefinedProperties::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; -} + +}; + +struct StaticDiagramInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDiagramInfoHelper_Initializer > +{ +}; /// clones a UNO-sequence of UNO-References typedef Reference< chart2::XCoordinateSystem > lcl_tCooSysRef; @@ -615,10 +620,7 @@ uno::Any Diagram::GetDefaultValue( sal_Int32 nHandle ) const // ____ OPropertySet ____ ::cppu::IPropertyArrayHelper & SAL_CALL Diagram::getInfoHelper() { - static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(), - /* bSorted = */ sal_True ); - - return aArrayHelper; + return *StaticDiagramInfoHelper::get(); } |