Kaydet (Commit) 92793340 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

framework: simplify deprecated XTypeProvider.getImplementationId

Change-Id: Id137a35c385a5198243eefb9a42f4deace24e195
üst 2598a15e
......@@ -56,26 +56,7 @@ ________________________________________________________________________________
#define PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CLASS::getImplementationId() throw( ::com::sun::star::uno::RuntimeException, std::exception ) \
{ \
/* Create one Id for all instances of this class. */ \
/* Use ethernet address to do this! (sal_True) */ \
/* 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; pID is NULL - for the second call pID is different from NULL! */ \
static ::cppu::OImplementationId* pID = NULL ; \
if ( pID == NULL ) \
{ \
/* Ready for multithreading; get global mutex for first call of this method only! see before */ \
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
/* Control these pointer again ... it can be, that another instance will be faster then these! */ \
if ( pID == NULL ) \
{ \
/* Create a new static ID ... */ \
static ::cppu::OImplementationId aID( false ); \
/* ... and set his address to static pointer! */ \
pID = &aID ; \
} \
} \
return pID->getImplementationId(); \
return css::uno::Sequence<sal_Int8>(); \
}
......
......@@ -156,30 +156,7 @@ Sequence< Type > SAL_CALL ActionTriggerContainer::getTypes() throw ( RuntimeExce
Sequence< sal_Int8 > SAL_CALL ActionTriggerContainer::getImplementationId() throw ( RuntimeException, std::exception )
{
// Create one Id for all instances of this class.
// Use ethernet address to do this! (sal_True)
// 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; pID is NULL - for the second call pID is different from NULL!
static ::cppu::OImplementationId* pID = NULL ;
if ( pID == NULL )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pID == NULL )
{
// Create a new static ID ...
static ::cppu::OImplementationId aID( false ) ;
// ... and set his address to static pointer!
pID = &aID ;
}
}
return pID->getImplementationId() ;
return css::uno::Sequence<sal_Int8>();
}
}
......
......@@ -153,30 +153,7 @@ Sequence< Type > SAL_CALL ActionTriggerPropertySet::getTypes() throw ( RuntimeEx
Sequence< sal_Int8 > SAL_CALL ActionTriggerPropertySet::getImplementationId() throw ( RuntimeException, std::exception )
{
// Create one Id for all instances of this class.
// Use ethernet address to do this! (sal_True)
// 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; pID is NULL - for the second call pID is different from NULL!
static ::cppu::OImplementationId* pID = NULL ;
if ( pID == NULL )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pID == NULL )
{
// Create a new static ID ...
static ::cppu::OImplementationId aID( false ) ;
// ... and set his address to static pointer!
pID = &aID ;
}
}
return pID->getImplementationId() ;
return css::uno::Sequence<sal_Int8>();
}
sal_Bool SAL_CALL ActionTriggerPropertySet::convertFastPropertyValue(
......
......@@ -146,30 +146,7 @@ Sequence< Type > SAL_CALL ActionTriggerSeparatorPropertySet::getTypes() throw (
Sequence< sal_Int8 > SAL_CALL ActionTriggerSeparatorPropertySet::getImplementationId() throw ( RuntimeException, std::exception )
{
// Create one Id for all instances of this class.
// Use ethernet address to do this! (sal_True)
// 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; pID is NULL - for the second call pID is different from NULL!
static ::cppu::OImplementationId* pID = NULL ;
if ( pID == NULL )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pID == NULL )
{
// Create a new static ID ...
static ::cppu::OImplementationId aID( false ) ;
// ... and set his address to static pointer!
pID = &aID ;
}
}
return pID->getImplementationId() ;
return css::uno::Sequence<sal_Int8>();
}
sal_Bool SAL_CALL ActionTriggerSeparatorPropertySet::convertFastPropertyValue(
......
......@@ -281,30 +281,7 @@ Sequence< Type > SAL_CALL RootActionTriggerContainer::getTypes() throw ( Runtime
Sequence< sal_Int8 > SAL_CALL RootActionTriggerContainer::getImplementationId() throw ( RuntimeException, std::exception )
{
// Create one Id for all instances of this class.
// Use ethernet address to do this! (sal_True)
// 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; pID is NULL - for the second call pID is different from NULL!
static ::cppu::OImplementationId* pID = NULL ;
if ( pID == NULL )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pID == NULL )
{
// Create a new static ID ...
static ::cppu::OImplementationId aID( false ) ;
// ... and set his address to static pointer!
pID = &aID ;
}
}
return pID->getImplementationId() ;
return css::uno::Sequence<sal_Int8>();
}
// private implementation helper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment