Kaydet (Commit) e8ec8ac4 authored tarafından Caolán McNamara's avatar Caolán McNamara

use standard template for this

üst 8f417441
......@@ -44,6 +44,7 @@
#include <vcl/msgbox.hxx>
// header for class OImplementationId
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/servicehelper.hxx>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
......@@ -162,15 +163,15 @@ uno::Sequence< uno::Type > CreationWizardUnoDlg::getTypes() throw(uno::RuntimeEx
return aTypeList;
}
namespace
{
class theCreationWizardUnoDlgImplementationId : public rtl::Static< UnoTunnelIdInit, theCreationWizardUnoDlgImplementationId > {};
}
uno::Sequence< sal_Int8 > SAL_CALL CreationWizardUnoDlg::getImplementationId( void ) throw( uno::RuntimeException )
{
static uno::Sequence< sal_Int8 > aId;
if( aId.getLength() == 0 )
{
aId.realloc( 16 );
rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
}
return aId;
return theCreationWizardUnoDlgImplementationId::get().getSeq();
}
//-------------------------------------------------------------------------
......
......@@ -119,30 +119,6 @@ static ::com::sun::star::uno::Reference< \
return (::cppu::OWeakObject *)new Class( xContext ); \
}
/** This macro contains the default implementation for getImplementationId().
Note, that you have to include the header necessary for rtl_createUuid.
Insert the following into your file:
<code>
#include <rtl/uuid.h>
</code>
@param Class the Class-Name for which getImplementationId() should be
implemented
*/
#define APPHELPER_GETIMPLEMENTATIONID_IMPL(Class) \
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL Class::getImplementationId() \
throw (::com::sun::star::uno::RuntimeException) \
{ \
static ::com::sun::star::uno::Sequence< sal_Int8 > aId; \
if( aId.getLength() == 0 ) \
{ \
aId.realloc( 16 ); \
rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); \
} \
return aId; \
}
}//end namespace apphelper
#endif
......
......@@ -31,8 +31,8 @@
#include "OPropertySet.hxx"
#include "ImplOPropertySet.hxx"
#include "ContainerHelper.hxx"
#include <rtl/uuid.h>
#include <cppuhelper/queryinterface.hxx>
#include <comphelper/servicehelper.hxx>
#include <vector>
#include <algorithm>
......@@ -133,20 +133,18 @@ Sequence< uno::Type > SAL_CALL
return aTypeList;
}
namespace
{
class theOPropertySetImplementationId : public rtl::Static< UnoTunnelIdInit, theOPropertySetImplementationId > {};
}
Sequence< sal_Int8 > SAL_CALL
OPropertySet::getImplementationId()
throw (uno::RuntimeException)
{
static uno::Sequence< sal_Int8 > aId;
if( aId.getLength() == 0 )
{
aId.realloc( 16 );
rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
}
return aId;
return theOPropertySetImplementationId::get().getSeq();
}
// ____ XPropertyState ____
beans::PropertyState SAL_CALL
OPropertySet::getPropertyState( const OUString& PropertyName )
......
......@@ -61,6 +61,7 @@
#include "DateHelper.hxx"
#include <comphelper/scopeguard.hxx>
#include <comphelper/servicehelper.hxx>
#include <boost/bind.hpp>
#include <unotools/streamwrap.hxx>
// header for class LocaleDataWrapper
......@@ -119,20 +120,14 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any;
using rtl::OUString;
namespace
{
class theExplicitValueProviderUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theExplicitValueProviderUnoTunnelId > {};
}
const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
if( !pSeq )
{
osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
if( !pSeq )
{
static uno::Sequence< sal_Int8 > aSeq( 16 );
rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
pSeq = &aSeq;
}
}
return *pSeq;
return theExplicitValueProviderUnoTunnelId::get().getSeq();
}
ExplicitValueProvider* ExplicitValueProvider::getExplicitValueProvider(
......
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