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/main/FormattedString.cxx | |
parent | f0a13fa4339ee940f267fb8787d6137b148abec9 (diff) |
chart49: #i113103# use corrected double-checked locking pattern for propertysetinfo
Diffstat (limited to 'chart2/source/model/main/FormattedString.cxx')
-rwxr-xr-x | chart2/source/model/main/FormattedString.cxx | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx index 0486423db092..ab9aa4f8b33d 100755 --- a/chart2/source/model/main/FormattedString.cxx +++ b/chart2/source/model/main/FormattedString.cxx @@ -73,6 +73,20 @@ struct StaticFormattedStringInfoHelper : public rtl::StaticAggregate< ::cppu::OP { }; +struct StaticFormattedStringInfo_Initializer +{ + uno::Reference< beans::XPropertySetInfo >* operator()() + { + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticFormattedStringInfoHelper::get() ) ); + return &xPropertySetInfo; + } +}; + +struct StaticFormattedStringInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticFormattedStringInfo_Initializer > +{ +}; + } // anonymous namespace namespace chart @@ -223,22 +237,10 @@ uno::Any FormattedString::GetDefaultValue( sal_Int32 nHandle ) const // ____ XPropertySet ____ -uno::Reference< beans::XPropertySetInfo > SAL_CALL - FormattedString::getPropertySetInfo() +uno::Reference< beans::XPropertySetInfo > SAL_CALL FormattedString::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 *StaticFormattedStringInfo::get(); } // ================================================================================ |