summaryrefslogtreecommitdiff
path: root/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/chartapiwrapper/TitleWrapper.cxx')
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/TitleWrapper.cxx28
1 files changed, 15 insertions, 13 deletions
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index 20785faa8b66..9a2183f089fe 100644..100755
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -182,35 +182,37 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticTitleWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
::chart::wrapper::WrappedScaleTextProperties::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 StaticTitleWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticTitleWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -526,7 +528,7 @@ Reference< beans::XPropertySet > TitleWrapper::getInnerPropertySet()
const Sequence< beans::Property >& TitleWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticTitleWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > TitleWrapper::createWrappedProperties()