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/Wall.cxx | |
parent | f0a13fa4339ee940f267fb8787d6137b148abec9 (diff) |
chart49: #i113103# use corrected double-checked locking pattern for propertysetinfo
Diffstat (limited to 'chart2/source/model/main/Wall.cxx')
-rwxr-xr-x | chart2/source/model/main/Wall.cxx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx index 5180191df49e..40bda5aa2465 100755 --- a/chart2/source/model/main/Wall.cxx +++ b/chart2/source/model/main/Wall.cxx @@ -94,6 +94,20 @@ struct StaticWallInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArra { }; +struct StaticWallInfo_Initializer +{ + uno::Reference< beans::XPropertySetInfo >* operator()() + { + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticWallInfoHelper::get() ) ); + return &xPropertySetInfo; + } +}; + +struct StaticWallInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticWallInfo_Initializer > +{ +}; + } // anonymous namespace // ================================================================================ @@ -160,24 +174,11 @@ uno::Any Wall::GetDefaultValue( sal_Int32 nHandle ) const return *StaticWallInfoHelper::get(); } - // ____ XPropertySet ____ -uno::Reference< beans::XPropertySetInfo > SAL_CALL - Wall::getPropertySetInfo() +uno::Reference< beans::XPropertySetInfo > SAL_CALL Wall::getPropertySetInfo() throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo; - - // /-- - MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !xInfo.is()) - { - xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( - getInfoHelper()); - } - - return xInfo; - // \-- + return *StaticWallInfo::get(); } // ____ XModifyBroadcaster ____ |