summaryrefslogtreecommitdiffstats
path: root/UnoControls/source/controls/progressmonitor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'UnoControls/source/controls/progressmonitor.cxx')
-rw-r--r--UnoControls/source/controls/progressmonitor.cxx30
1 files changed, 6 insertions, 24 deletions
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index 3354e60131c1..cabdc1a15ddc 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -147,31 +147,13 @@ void SAL_CALL ProgressMonitor::release() throw()
// XTypeProvider
Sequence< Type > SAL_CALL ProgressMonitor::getTypes()
{
- // Optimize this method !
- // We initialize a static variable only one time. And we don't must use a mutex at every call!
- // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
- static OTypeCollection* pTypeCollection = nullptr;
+ static OTypeCollection ourTypeCollection(
+ cppu::UnoType<XLayoutConstrains>::get(),
+ cppu::UnoType<XButton>::get(),
+ cppu::UnoType<XProgressMonitor>::get(),
+ BaseContainerControl::getTypes() );
- if ( pTypeCollection == nullptr )
- {
- // Ready for multithreading; get global mutex for first call of this method only! see before
- MutexGuard aGuard( Mutex::getGlobalMutex() );
-
- // Control these pointer again ... it can be, that another instance will be faster then these!
- if ( pTypeCollection == nullptr )
- {
- // Create a static typecollection ...
- static OTypeCollection aTypeCollection ( cppu::UnoType<XLayoutConstrains>::get(),
- cppu::UnoType<XButton>::get(),
- cppu::UnoType<XProgressMonitor>::get(),
- BaseContainerControl::getTypes()
- );
- // ... and set his address to static pointer!
- pTypeCollection = &aTypeCollection;
- }
- }
-
- return pTypeCollection->getTypes();
+ return ourTypeCollection.getTypes();
}
// XAggregation