diff options
author | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-01-15 17:21:37 +0100 |
---|---|---|
committer | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-01-15 17:21:37 +0100 |
commit | 2ce9a356b9c14263008c3c182d5e69508d2c9107 (patch) | |
tree | f3e07ed0cf867aea00cfd1ac1bbce09ccfabe323 /chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | |
parent | df4eb12515da36973ad00eb2ae2b18ca303646c7 (diff) | |
parent | a7417580c63270351601a7aef27c11247a831206 (diff) |
chart46: merge with DEV300_m97
Diffstat (limited to 'chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx')
-rwxr-xr-x[-rw-r--r--] | chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index 16992ac02b51..e365edb7bd46 100644..100755 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -432,15 +432,17 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEDEFAULT )); } -const uno::Sequence< Property > & lcl_GetPropertySequence() +struct StaticDiagramWrapperPropertyArray_Initializer { - static uno::Sequence< Property > aPropSeq; + Sequence< Property >* operator()() + { + static Sequence< Property > aPropSeq( lcl_GetPropertySequence() ); + return &aPropSeq; + } - // /-- - 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 ); @@ -454,16 +456,16 @@ const uno::Sequence< Property > & lcl_GetPropertySequence() WrappedStockProperties::addProperties( aProperties ); WrappedAutomaticPositionProperties::addProperties( 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 StaticDiagramWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticDiagramWrapperPropertyArray_Initializer > +{ +}; bool lcl_isXYChart( const Reference< chart2::XDiagram > xDiagram ) { @@ -568,7 +570,6 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName ) } typedef ::comphelper::MakeMap< ::rtl::OUString, ::rtl::OUString > tMakeStringStringMap; -//static const tMakeStringStringMap& lcl_getChartTypeNameMap() { static tMakeStringStringMap g_aChartTypeNameMap = @@ -2088,7 +2089,7 @@ Reference< beans::XPropertySet > DiagramWrapper::getInnerPropertySet() const Sequence< beans::Property >& DiagramWrapper::getPropertySequence() { - return lcl_GetPropertySequence(); + return *StaticDiagramWrapperPropertyArray::get(); } const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties() |