diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 15:11:37 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 15:11:37 +0100 |
commit | 9fba7e804f5b72b58b7bb2799238eb72c531ce08 (patch) | |
tree | 6c1a597349965683af983a422dd54c6e3afffd0a /chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | |
parent | ace88acbc3ac297b64bf0b5dbe46ceebd9718c26 (diff) | |
parent | b903a1de34f5fc3694c696110c1f00b97d60299f (diff) |
CWS-TOOLING: integrate CWS chart49
Diffstat (limited to 'chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx')
-rwxr-xr-x[-rw-r--r--] | chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index d6487d425657..e8d91cd6c124 100644..100755 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -249,28 +249,30 @@ void lcl_AddPropertiesToVector( beans::PropertyAttribute::MAYBEDEFAULT ) ); } -const uno::Sequence< Property > & lcl_GetPropertySequence() +struct StaticChartDocumentWrapperPropertyArray_Initializer { - static uno::Sequence< Property > aPropSeq; + Sequence< Property >* operator()() + { + static Sequence< Property > aPropSeq( lcl_GetPropertySequence() ); + return &aPropSeq; + } - // /-- - MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aPropSeq.getLength() ) +private: + uno::Sequence< Property > lcl_GetPropertySequence() { - // get properties ::std::vector< ::com::sun::star::beans::Property > aProperties; lcl_AddPropertiesToVector( aProperties ); - // and sort them for access via bsearch ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() ); - // transfer result to static Sequence - aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties ); + return ::chart::ContainerHelper::ContainerToSequence( aProperties ); } +}; - return aPropSeq; -} +struct StaticChartDocumentWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticChartDocumentWrapperPropertyArray_Initializer > +{ +}; } // anonymous namespace @@ -1582,7 +1584,7 @@ Reference< beans::XPropertySet > ChartDocumentWrapper::getInnerPropertySet() } const Sequence< beans::Property >& ChartDocumentWrapper::getPropertySequence() { - return lcl_GetPropertySequence(); + return *StaticChartDocumentWrapperPropertyArray::get(); } const std::vector< WrappedProperty* > ChartDocumentWrapper::createWrappedProperties() |