summaryrefslogtreecommitdiff
path: root/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/chartapiwrapper/AxisWrapper.cxx')
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/AxisWrapper.cxx29
1 files changed, 15 insertions, 14 deletions
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 6d53fb8b01f6..ebb9459e7d54 100644..100755
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -323,33 +323,35 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAxisWrapperPropertyArray_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< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( 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 StaticAxisWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAxisWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -428,7 +430,6 @@ uno::Reference< util::XNumberFormats > SAL_CALL AxisWrapper::getNumberFormats()
return uno::Reference< util::XNumberFormats >();
}
-// static
void AxisWrapper::getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDimensionIndex, sal_Bool& rbMainAxis )
{
switch( eType )
@@ -532,7 +533,7 @@ Reference< beans::XPropertySet > AxisWrapper::getInnerPropertySet()
const Sequence< beans::Property >& AxisWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticAxisWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > AxisWrapper::createWrappedProperties()