summaryrefslogtreecommitdiff
path: root/chart2/source/model/main/StockBar.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/main/StockBar.cxx
parentf0a13fa4339ee940f267fb8787d6137b148abec9 (diff)
chart49: #i113103# use corrected double-checked locking pattern for propertysetinfo
Diffstat (limited to 'chart2/source/model/main/StockBar.cxx')
-rwxr-xr-xchart2/source/model/main/StockBar.cxx31
1 files changed, 16 insertions, 15 deletions
diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx
index 73639211677f..098bbdd18f96 100755
--- a/chart2/source/model/main/StockBar.cxx
+++ b/chart2/source/model/main/StockBar.cxx
@@ -85,6 +85,20 @@ struct StaticStockBarInfoHelper : public rtl::StaticAggregate< ::cppu::OProperty
{
};
+struct StaticStockBarInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticStockBarInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticStockBarInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticStockBarInfo_Initializer >
+{
+};
+
void lcl_AddDefaultsToMap(
::chart::tPropertyValueMap & rOutMap )
{
@@ -168,25 +182,12 @@ uno::Any StockBar::GetDefaultValue( sal_Int32 nHandle ) const
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- StockBar::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL StockBar::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticStockBarInfo::get();
}
-
// ____ XModifyBroadcaster ____
void SAL_CALL StockBar::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
throw (uno::RuntimeException)