summaryrefslogtreecommitdiff
path: root/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx')
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx27
1 files changed, 14 insertions, 13 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index c0be0ddcbf0d..c174614a0bf3 100644..100755
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -434,15 +434,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 );
@@ -456,16 +458,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 )
{
@@ -570,7 +572,6 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
}
typedef ::comphelper::MakeMap< ::rtl::OUString, ::rtl::OUString > tMakeStringStringMap;
-//static
const tMakeStringStringMap& lcl_getChartTypeNameMap()
{
static tMakeStringStringMap g_aChartTypeNameMap =
@@ -2085,7 +2086,7 @@ Reference< beans::XPropertySet > DiagramWrapper::getInnerPropertySet()
const Sequence< beans::Property >& DiagramWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticDiagramWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()