summaryrefslogtreecommitdiffstats
path: root/chart2/source/model/main/Wall.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/model/main/Wall.cxx')
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Wall.cxx32
1 files changed, 13 insertions, 19 deletions
diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx
index 2ad00a4c90ae..5180191df49e 100644..100755
--- a/chart2/source/model/main/Wall.cxx
+++ b/chart2/source/model/main/Wall.cxx
@@ -66,39 +66,33 @@ void lcl_AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
}
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticWallInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- 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;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::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;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticWallInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticWallInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
-}
+};
} // anonymous namespace
@@ -163,7 +157,7 @@ uno::Any Wall::GetDefaultValue( sal_Int32 nHandle ) const
::cppu::IPropertyArrayHelper & SAL_CALL Wall::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticWallInfoHelper::get();
}