[Libreoffice-commits] .: chart2/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Jun 3 05:45:53 PDT 2011
chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx | 15 ++++---
chart2/source/inc/ServiceMacros.hxx | 24 ------------
chart2/source/tools/OPropertySet.cxx | 16 +++-----
chart2/source/view/main/ChartView.cxx | 19 +++------
4 files changed, 22 insertions(+), 52 deletions(-)
New commits:
commit 9cb1503497491693776d8c15b23451e399ea9b70
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 3 12:32:02 2011 +0100
use standard template for this
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index 37dfd72..b6bd40b 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -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();
}
//-------------------------------------------------------------------------
diff --git a/chart2/source/inc/ServiceMacros.hxx b/chart2/source/inc/ServiceMacros.hxx
index edad6d8..7371100 100644
--- a/chart2/source/inc/ServiceMacros.hxx
+++ b/chart2/source/inc/ServiceMacros.hxx
@@ -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
diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx
index 6444369..cdd3a1b 100644
--- a/chart2/source/tools/OPropertySet.cxx
+++ b/chart2/source/tools/OPropertySet.cxx
@@ -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 )
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 2a61696..7fdeaa2 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -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(
More information about the Libreoffice-commits
mailing list