diff options
author | Ingrid Halama <iha@openoffice.org> | 2010-10-06 13:53:07 +0200 |
---|---|---|
committer | Ingrid Halama <iha@openoffice.org> | 2010-10-06 13:53:07 +0200 |
commit | 63af9d6233ba3858a66a1f634d7f7fd7acdc03fa (patch) | |
tree | bc97661de4944e02437300e8b617bf6a52b6b210 /chart2/source/model/template/ScatterChartType.cxx | |
parent | f0a13fa4339ee940f267fb8787d6137b148abec9 (diff) |
chart49: #i113103# use corrected double-checked locking pattern for propertysetinfo
Diffstat (limited to 'chart2/source/model/template/ScatterChartType.cxx')
-rwxr-xr-x | chart2/source/model/template/ScatterChartType.cxx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx index 559711794405..571784928f04 100755 --- a/chart2/source/model/template/ScatterChartType.cxx +++ b/chart2/source/model/template/ScatterChartType.cxx @@ -119,6 +119,20 @@ struct StaticScatterChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::O { }; +struct StaticScatterChartTypeInfo_Initializer +{ + uno::Reference< beans::XPropertySetInfo >* operator()() + { + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticScatterChartTypeInfoHelper::get() ) ); + return &xPropertySetInfo; + } +}; + +struct StaticScatterChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticScatterChartTypeInfo_Initializer > +{ +}; + } // anonymous namespace namespace chart @@ -260,24 +274,11 @@ uno::Any ScatterChartType::GetDefaultValue( sal_Int32 nHandle ) const return *StaticScatterChartTypeInfoHelper::get(); } - // ____ XPropertySet ____ -uno::Reference< beans::XPropertySetInfo > SAL_CALL - ScatterChartType::getPropertySetInfo() +uno::Reference< beans::XPropertySetInfo > SAL_CALL ScatterChartType::getPropertySetInfo() throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !xInfo.is()) - { - xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( - getInfoHelper()); - } - - return xInfo; - // \-- + return *StaticScatterChartTypeInfo::get(); } uno::Sequence< ::rtl::OUString > ScatterChartType::getSupportedServiceNames_Static() |