summaryrefslogtreecommitdiff
path: root/chart2/source/model/template/NetChartType.cxx
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-10-06 13:53:07 +0200
committerIngrid Halama <iha@openoffice.org>2010-10-06 13:53:07 +0200
commit63af9d6233ba3858a66a1f634d7f7fd7acdc03fa (patch)
treebc97661de4944e02437300e8b617bf6a52b6b210 /chart2/source/model/template/NetChartType.cxx
parentf0a13fa4339ee940f267fb8787d6137b148abec9 (diff)
chart49: #i113103# use corrected double-checked locking pattern for propertysetinfo
Diffstat (limited to 'chart2/source/model/template/NetChartType.cxx')
-rwxr-xr-xchart2/source/model/template/NetChartType.cxx54
1 files changed, 37 insertions, 17 deletions
diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx
index ddf001b2a6e4..bba666bb006c 100755
--- a/chart2/source/model/template/NetChartType.cxx
+++ b/chart2/source/model/template/NetChartType.cxx
@@ -108,31 +108,51 @@ uno::Any NetChartType_Base::GetDefaultValue( sal_Int32 /*nHandle*/ ) const
return uno::Any();
}
+namespace
+{
+
+struct StaticNetChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ // using assignment for broken gcc 3.3
+ static ::cppu::OPropertyArrayHelper aPropHelper = ::cppu::OPropertyArrayHelper(
+ Sequence< beans::Property >() );
+ return &aPropHelper;
+ }
+};
+
+struct StaticNetChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticNetChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticNetChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticNetChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticNetChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticNetChartTypeInfo_Initializer >
+{
+};
+
+}
+
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL NetChartType_Base::getInfoHelper()
{
- uno::Sequence< beans::Property > aProps;
- static ::cppu::OPropertyArrayHelper aArrayHelper(aProps);
- return aArrayHelper;
+ return *StaticNetChartTypeInfoHelper::get();
}
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- NetChartType_Base::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL NetChartType_Base::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 *StaticNetChartTypeInfo::get();
}
//-----------------------------------------------------------------------------