[Libreoffice-commits] .: 17 commits - bridges/source cppu/source desktop/inc desktop/source drawinglayer/source editeng/inc editeng/source forms/source framework/source io/source moz/extractfiles.mk sal/inc sal/rtl sfx2/inc solenv/gbuild svtools/source svx/source vcl/inc vcl/source
Stephan Bergmann
sbergmann at kemper.freedesktop.org
Fri Sep 9 09:22:47 PDT 2011
bridges/source/cpp_uno/cc50_solaris_intel/except.cxx | 21
bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx | 21
bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx | 19
bridges/source/cpp_uno/gcc3_ios_arm/except.cxx | 19
bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_arm/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_intel/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_mips/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_s390/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx | 20
bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx | 12
bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx | 20
bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx | 20
bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx | 20
bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx | 20
bridges/source/cpp_uno/mingw_intel/except.cxx | 20
bridges/source/cpp_uno/msvc_win32_intel/except.cxx | 18
bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx | 19
cppu/source/uno/data.cxx | 112 +-
desktop/inc/app.hxx | 3
desktop/source/app/app.cxx | 22
desktop/source/app/lockfile.cxx | 9
desktop/source/app/lockfile.hxx | 3
desktop/source/offacc/acceptor.cxx | 1
drawinglayer/source/processor3d/zbufferprocessor3d.cxx | 21
editeng/inc/editeng/unopracc.hxx | 14
editeng/inc/editeng/unotext.hxx | 151 +--
editeng/source/uno/unopracc.cxx | 64 -
editeng/source/uno/unotext.cxx | 258 ------
editeng/source/uno/unotext2.cxx | 199 -----
forms/source/component/FormattedFieldWrapper.cxx | 170 +---
forms/source/component/FormattedFieldWrapper.hxx | 3
framework/source/layoutmanager/toolbarlayoutmanager.cxx | 14
framework/source/layoutmanager/toolbarlayoutmanager.hxx | 5
framework/source/uiconfiguration/imagemanager.cxx | 14
framework/source/uiconfiguration/imagemanagerimpl.cxx | 22
framework/source/uiconfiguration/imagemanagerimpl.hxx | 14
framework/source/uiconfiguration/moduleimagemanager.cxx | 14
io/source/TextInputStream/TextInputStream.cxx | 1
io/source/TextOutputStream/TextOutputStream.cxx | 2
io/source/connector/connector.cxx | 1
io/source/stm/odata.cxx | 141 ---
moz/extractfiles.mk | 11
sal/inc/rtl/bootstrap.h | 4
sal/rtl/source/bootstrap.cxx | 635 +++++-----------
sfx2/inc/sfx2/sfxuno.hxx | 1
solenv/gbuild/CppunitTest.mk | 2
solenv/gbuild/JunitTest.mk | 6
solenv/gbuild/platform/solaris.mk | 5
svtools/source/graphic/graphic.cxx | 19
svtools/source/graphic/graphic.hxx | 1
svx/source/table/cell.cxx | 74 -
svx/source/table/cell.hxx | 25
svx/source/unodraw/unoshape.cxx | 10
vcl/inc/vcl/graph.hxx | 2
vcl/source/gdi/graph.cxx | 17
62 files changed, 682 insertions(+), 1857 deletions(-)
New commits:
commit d3794d2d8ab2ee3f8118d61538bb753335b37f23
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 17:31:07 2011 +0200
sb140: #i117295# use rtl::Static
diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx
index 6a9b923..061c374 100644
--- a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx
+++ b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx
@@ -36,6 +36,7 @@
#include <list>
#include <map>
#include <rtl/alloc.h>
+#include <rtl/instance.hxx>
#include <osl/diagnose.h>
#include <rtl/strbuf.hxx>
@@ -313,6 +314,8 @@ void* RTTIHolder::generateRTTI( typelib_CompoundTypeDescription * pCompTypeDescr
return pRTTI;
}
+struct RTTISingleton: public rtl::Static< RTTIHolder, RTTISingleton > {};
+
//__________________________________________________________________________________________________
static void deleteException(
@@ -345,23 +348,7 @@ void cc50_solaris_intel_raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cp
// will be released by deleteException
typelib_typedescriptionreference_getDescription( &pTypeDescr, pUnoExc->pType );
- void* pRTTI;
- {
- static ::osl::Mutex aMutex;
- ::osl::Guard< ::osl::Mutex > guard( aMutex );
-
- static RTTIHolder * s_pRTTI = 0;
- if (! s_pRTTI)
- {
-#ifdef LEAK_STATIC_DATA
- s_pRTTI = new RTTIHolder();
-#else
- static RTTIHolder s_aRTTI;
- s_pRTTI = &s_aRTTI;
-#endif
- }
-
- pRTTI = s_pRTTI->generateRTTI( (typelib_CompoundTypeDescription *)pTypeDescr );
+ pRTTI = RTTISingleton::get().generateRTTI( (typelib_CompoundTypeDescription *)pTypeDescr );
}
// a must be
diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
index 84ce64e..6759d79 100644
--- a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
+++ b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
@@ -36,6 +36,7 @@
#include <list>
#include <map>
#include <rtl/alloc.h>
+#include <rtl/instance.hxx>
#include <osl/diagnose.h>
#include <typelib/typedescription.hxx>
#include <com/sun/star/uno/Any.hxx>
@@ -315,6 +316,8 @@ void* RTTIHolder::generateRTTI( typelib_CompoundTypeDescription * pCompTypeDescr
return pRTTI;
}
+struct RTTISingleton: public rtl::Static< RTTIHolder, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException(
@@ -348,23 +351,7 @@ void cc50_solaris_sparc_raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cp
// will be released by deleteException
typelib_typedescriptionreference_getDescription( &pTypeDescr, pUnoExc->pType );
- void* pRTTI;
- {
- static ::osl::Mutex aMutex;
- ::osl::Guard< ::osl::Mutex > guard( aMutex );
-
- static RTTIHolder * s_pRTTI = 0;
- if (! s_pRTTI)
- {
-#ifdef LEAK_STATIC_DATA
- s_pRTTI = new RTTIHolder();
-#else
- static RTTIHolder s_aRTTI;
- s_pRTTI = &s_aRTTI;
-#endif
- }
-
- pRTTI = s_pRTTI->generateRTTI( (typelib_CompoundTypeDescription *)pTypeDescr );
+ pRTTI = RTTISingleton::get().generateRTTI( (typelib_CompoundTypeDescription *)pTypeDescr );
}
// a must be
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
index 2086ef7..6ce9103 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
@@ -34,6 +34,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -205,6 +206,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -240,21 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
// avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
index a14bc8b..b2f8c03 100644
--- a/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
@@ -34,6 +34,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -253,21 +256,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
// avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
index ea4188b..337ceff 100644
--- a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx
@@ -35,6 +35,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -240,22 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
index d8452d8..230d86f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
@@ -32,6 +32,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -205,6 +206,8 @@ namespace CPPU_CURRENT_NAMESPACE
return rtti;
}
+ struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -251,22 +254,7 @@ namespace CPPU_CURRENT_NAMESPACE
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx
index 1128f0f..84c642e 100644
--- a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx
@@ -32,6 +32,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -205,6 +206,8 @@ namespace CPPU_CURRENT_NAMESPACE
return rtti;
}
+ struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -251,22 +254,7 @@ namespace CPPU_CURRENT_NAMESPACE
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx
index ea4188b..64d4548 100644
--- a/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx
@@ -35,6 +35,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -240,22 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
index 02ac42b..155640d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
@@ -36,6 +36,7 @@
#include <cxxabi.h>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -215,6 +216,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -261,22 +264,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx
index 1128f0f..84c642e 100644
--- a/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx
@@ -32,6 +32,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -205,6 +206,8 @@ namespace CPPU_CURRENT_NAMESPACE
return rtti;
}
+ struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -251,22 +254,7 @@ namespace CPPU_CURRENT_NAMESPACE
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx
index f4c4e24..804433d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx
@@ -31,6 +31,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -202,6 +203,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -248,22 +251,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx
index ea4188b..64d4548 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx
@@ -35,6 +35,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -240,22 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx
index ea4188b..64d4548 100644
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx
@@ -35,6 +35,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -240,22 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx
index ea4188b..64d4548 100644
--- a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx
@@ -35,6 +35,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -240,22 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx
index ea4188b..337ceff 100644
--- a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx
@@ -35,6 +35,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -240,22 +243,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx
index f958480..da3df34 100644
--- a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx
@@ -34,6 +34,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -205,6 +206,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -251,22 +254,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
index 74b2b73..b22335f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
@@ -35,9 +35,9 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtl/instance.hxx>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
@@ -216,6 +216,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -231,11 +233,6 @@ static void deleteException( void * pExc )
}
}
-namespace
-{
- struct theRTTI : public rtl::Static<RTTI, theRTTI> {};
-}
-
//==================================================================================================
void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
{
@@ -268,8 +265,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
// avoiding locked counts
- static RTTI &rRTTI = theRTTI::get();
- rtti = rRTTI.getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx
index a14bc8b..888e6f8 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx
@@ -34,6 +34,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -252,22 +255,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx
index 274f999..d8220eb 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx
@@ -34,6 +34,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -205,6 +206,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -239,22 +242,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx
index 4779b14..bd18ceb 100644
--- a/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx
@@ -34,6 +34,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -206,6 +207,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -252,22 +255,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx
index fef8c3f..7e493d3 100644
--- a/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx
@@ -33,6 +33,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -204,6 +205,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -250,22 +253,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/mingw_intel/except.cxx b/bridges/source/cpp_uno/mingw_intel/except.cxx
index 5997c3b..13db595 100644
--- a/bridges/source/cpp_uno/mingw_intel/except.cxx
+++ b/bridges/source/cpp_uno/mingw_intel/except.cxx
@@ -34,6 +34,7 @@
#include <cxxabi.h>
#include <boost/unordered_map.hpp>
+#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
@@ -191,6 +192,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
return rtti;
}
+struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {};
+
//--------------------------------------------------------------------------------------------------
static void deleteException( void * pExc )
{
@@ -237,22 +240,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// destruct uno exception
::uno_any_destruct( pUnoExc, 0 );
- // avoiding locked counts
- static RTTI * s_rtti = 0;
- if (! s_rtti)
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if (! s_rtti)
- {
-#ifdef LEAK_STATIC_DATA
- s_rtti = new RTTI();
-#else
- static RTTI rtti_data;
- s_rtti = &rtti_data;
-#endif
- }
- }
- rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ rtti = (type_info *)RTTISingleton::get().getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
index e8ac31e..b1bbe0d 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
@@ -38,6 +38,7 @@
#include <signal.h>
#include "rtl/alloc.h"
+#include <rtl/instance.hxx>
#include "rtl/strbuf.hxx"
#include "rtl/ustrbuf.hxx"
@@ -185,6 +186,7 @@ RTTInfos::~RTTInfos() throw ()
}
}
+struct RTTISingleton: public rtl::Static< RTTInfos, RTTISingleton > {};
//##################################################################################################
//#### Exception raising ###########################################################################
@@ -455,21 +457,7 @@ void * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTypeDescr ) thro
//##################################################################################################
type_info * msci_getRTTI( OUString const & rUNOname )
{
- static RTTInfos * s_pRTTIs = 0;
- if (! s_pRTTIs)
- {
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- if (! s_pRTTIs)
- {
-#ifdef LEAK_STATIC_DATA
- s_pRTTIs = new RTTInfos();
-#else
- static RTTInfos s_aRTTIs;
- s_pRTTIs = &s_aRTTIs;
-#endif
- }
- }
- return s_pRTTIs->getRTTI( rUNOname );
+ return RTTISingleton::get().getRTTI( rUNOname );
}
//##################################################################################################
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index 2157568..ac0da41 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -254,6 +254,7 @@ void
#include <signal.h>
#include "rtl/alloc.h"
+#include <rtl/instance.hxx>
#include "rtl/strbuf.hxx"
#include "rtl/ustrbuf.hxx"
@@ -660,24 +661,12 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw
return pRaiseInfo;
}
+struct RTTISingleton: public rtl::Static< RTTInfos, RTTISingleton > {};
+
type_info * mscx_getRTTI(
OUString const & rUNOname )
{
- static RTTInfos * s_pRTTIs = 0;
- if (! s_pRTTIs)
- {
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- if (! s_pRTTIs)
- {
-#ifdef LEAK_STATIC_DATA
- s_pRTTIs = new RTTInfos();
-#else
- static RTTInfos s_aRTTIs;
- s_pRTTIs = &s_aRTTIs;
-#endif
- }
- }
- return s_pRTTIs->getRTTI( rUNOname );
+ return RTTISingleton::get().getRTTI( rUNOname );
}
void mscx_raiseException(
commit afe7061d8ba46629f610991b5d35f5e0668fcf89
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 17:11:19 2011 +0200
sb140: #i117294# removed unused mutex guard
diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx
index 754b31b..5bd7b2f 100644
--- a/sfx2/inc/sfx2/sfxuno.hxx
+++ b/sfx2/inc/sfx2/sfxuno.hxx
@@ -539,7 +539,6 @@ bool GetEncryptionData_Impl( const SfxItemSet* pSet, ::com::sun::star::uno::Sequ
/* Helper for XServiceInfo */ \
UNOSEQUENCE< UNOOUSTRING > IMPLCLASS::impl_getStaticSupportedServiceNames() \
{ \
- UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() ); \
UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 1 ); \
seqServiceNames.getArray() [0] = UNOOUSTRING::createFromAscii( IMPLSERVICENAME ); \
return seqServiceNames ; \
commit 16ffd2fd242b1c98cbafedb1015107713957c2e9
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 17:06:55 2011 +0200
sb140: #i117292# use ImplInheritanceHelper
diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx
index dc2b574..4d8f931 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -31,7 +31,6 @@
#include <string.h>
-#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <rtl/unload.h>
diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx
index bd4325a..5952601 100644
--- a/io/source/TextOutputStream/TextOutputStream.cxx
+++ b/io/source/TextOutputStream/TextOutputStream.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_io.hxx"
-
-#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <uno/mapping.hxx>
diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx
index 38a44ea..04ef646 100644
--- a/io/source/connector/connector.cxx
+++ b/io/source/connector/connector.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_io.hxx"
-#include <osl/mutex.hxx>
#include "osl/security.hxx"
#include <uno/mapping.hxx>
diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx
index 338df98..a761947 100644
--- a/io/source/stm/odata.cxx
+++ b/io/source/stm/odata.cxx
@@ -46,11 +46,8 @@
#include <cppuhelper/weak.hxx> // OWeakObject
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase4.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/queryinterface.hxx>
-
-#include <osl/mutex.hxx>
#include <string.h>
@@ -962,10 +959,8 @@ typedef boost::unordered_map
*
*
*--------------------------------------------*/
-class OObjectOutputStream :
- public ODataOutputStream,
- public XObjectOutputStream,
- public XMarkableStream
+class OObjectOutputStream: public ImplInheritanceHelper2<
+ ODataOutputStream, XObjectOutputStream, XMarkableStream >
{
public:
OObjectOutputStream()
@@ -978,11 +973,6 @@ public:
~OObjectOutputStream();
public:
- Any SAL_CALL queryInterface( const Type &type ) throw (::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { ODataOutputStream::acquire(); }
- void SAL_CALL release() throw() { ODataOutputStream::release(); }
-
-public:
// XOutputStream
virtual void SAL_CALL writeBytes(const Sequence< sal_Int8 >& aData)
throw ( NotConnectedException,
@@ -1034,12 +1024,6 @@ public: // XMarkableStream
virtual sal_Int32 SAL_CALL offsetToMark(sal_Int32 nMark)
throw (IOException, IllegalArgumentException, RuntimeException);
-public: //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
- getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
- getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
-
public: // XServiceInfo
OUString SAL_CALL getImplementationName() throw ();
Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw ();
@@ -1059,20 +1043,6 @@ OObjectOutputStream::~OObjectOutputStream()
g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
-Any OObjectOutputStream::queryInterface( const Type &aType ) throw (::com::sun::star::uno::RuntimeException)
-{
- Any a = ::cppu::queryInterface(
- aType ,
- SAL_STATIC_CAST( XMarkableStream * , this ),
- SAL_STATIC_CAST( XObjectOutputStream * , this ) );
- if( a.hasValue() )
- {
- return a;
- }
-
- return ODataOutputStream::queryInterface( aType );
-
-}
void OObjectOutputStream::writeObject( const Reference< XPersistObject > & xPObj ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
@@ -1237,40 +1207,6 @@ Sequence<OUString> OObjectOutputStream_getSupportedServiceNames(void)
return aRet;
}
-Sequence< Type > SAL_CALL OObjectOutputStream::getTypes(void) throw( RuntimeException )
-{
- static OTypeCollection *pCollection = 0;
- if( ! pCollection )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pCollection )
- {
- static OTypeCollection collection(
- getCppuType( (Reference< XMarkableStream > * ) 0 ),
- getCppuType( (Reference< XObjectOutputStream > * ) 0 ),
- ODataOutputStream::getTypes() );
- pCollection = &collection;
- }
- }
- return (*pCollection).getTypes();
-}
-
-Sequence< sal_Int8 > SAL_CALL OObjectOutputStream::getImplementationId( ) throw( RuntimeException)
-{
- static OImplementationId *pId = 0;
- if( ! pId )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pId )
- {
- static OImplementationId id( sal_False );
- pId = &id;
- }
- }
- return (*pId).getImplementationId();
-}
-
-
// XServiceInfo
OUString OObjectOutputStream::getImplementationName() throw ()
{
@@ -1296,14 +1232,8 @@ Sequence< OUString > OObjectOutputStream::getSupportedServiceNames(void) throw (
return OObjectOutputStream_getSupportedServiceNames();
}
-
-
-
-
-class OObjectInputStream :
- public ODataInputStream,
- public XObjectInputStream,
- public XMarkableStream
+class OObjectInputStream: public ImplInheritanceHelper2<
+ ODataInputStream, XObjectInputStream, XMarkableStream >
{
public:
OObjectInputStream( const Reference < XComponentContext > &r)
@@ -1315,11 +1245,6 @@ public:
}
~OObjectInputStream();
-public:
- Any SAL_CALL queryInterface( const Type &type ) throw();
- void SAL_CALL acquire() throw() { ODataInputStream::acquire(); }
- void SAL_CALL release() throw() { ODataInputStream::release(); }
-
public: // XInputStream
virtual sal_Int32 SAL_CALL readBytes(Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
throw ( NotConnectedException,
@@ -1381,12 +1306,6 @@ public: // XMarkableStream
virtual sal_Int32 SAL_CALL offsetToMark(sal_Int32 nMark)
throw (IOException, IllegalArgumentException, RuntimeException);
-public: //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
- getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
- getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
-
public: // XServiceInfo
OUString SAL_CALL getImplementationName() throw ();
Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw ();
@@ -1408,21 +1327,6 @@ OObjectInputStream::~OObjectInputStream()
g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
-Any OObjectInputStream::queryInterface( const Type &aType ) throw ()
-{
- Any a = ::cppu::queryInterface(
- aType ,
- SAL_STATIC_CAST( XMarkableStream * , this ),
- SAL_STATIC_CAST( XObjectInputStream * , this ) );
- if( a.hasValue() )
- {
- return a;
- }
-
- return ODataInputStream::queryInterface( aType );
-
-}
-
Reference< XPersistObject > OObjectInputStream::readObject() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
// check if chain contains a XMarkableStream
@@ -1578,41 +1482,6 @@ sal_Int32 OObjectInputStream::offsetToMark(sal_Int32 nMark)
return m_rMarkable->offsetToMark( nMark );
}
-
-Sequence< Type > SAL_CALL OObjectInputStream::getTypes(void) throw( RuntimeException )
-{
- static OTypeCollection *pCollection = 0;
- if( ! pCollection )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pCollection )
- {
- static OTypeCollection collection(
- getCppuType( (Reference< XMarkableStream > * ) 0 ),
- getCppuType( (Reference< XObjectInputStream > * ) 0 ),
- ODataInputStream::getTypes() );
- pCollection = &collection;
- }
- }
- return (*pCollection).getTypes();
-}
-
-Sequence< sal_Int8 > SAL_CALL OObjectInputStream::getImplementationId( ) throw( RuntimeException)
-{
- static OImplementationId *pId = 0;
- if( ! pId )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pId )
- {
- static OImplementationId id( sal_False );
- pId = &id;
- }
- }
- return (*pId).getImplementationId();
-}
-
-
// XServiceInfo
OUString OObjectInputStream::getImplementationName() throw ()
{
commit 7275be15191c08009ac9c359163e3eeb1be25ca7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 17:06:45 2011 +0200
sb140: #i117291# do not mis-use XTypeProvider.getImplementationId in XUnoTunnel.getSomething
diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx
index cf212d9..315f370 100644
--- a/svtools/source/graphic/graphic.cxx
+++ b/svtools/source/graphic/graphic.cxx
@@ -114,19 +114,6 @@ void SAL_CALL Graphic::release() throw()
// ------------------------------------------------------------------------------
-namespace
-{
- class theGraphicUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theGraphicUnoTunnelId > {};
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL Graphic::getImplementationId_Static()
- throw(uno::RuntimeException)
-{
- return theGraphicUnoTunnelId::get().getSeq();
-}
-
-// ------------------------------------------------------------------------------
-
::rtl::OUString Graphic::getImplementationName_Static()
throw()
{
@@ -210,7 +197,7 @@ uno::Sequence< uno::Type > SAL_CALL Graphic::getTypes()
uno::Sequence< sal_Int8 > SAL_CALL Graphic::getImplementationId()
throw(uno::RuntimeException)
{
- return getImplementationId_Static();
+ return uno::Sequence< sal_Int8 >();
}
// ------------------------------------------------------------------------------
@@ -282,14 +269,14 @@ const ::Graphic* Graphic::getImplementation( const uno::Reference< uno::XInterfa
throw()
{
uno::Reference< lang::XUnoTunnel > xTunnel( rxIFace, uno::UNO_QUERY );
- return( xTunnel.is() ? reinterpret_cast< ::Graphic* >( xTunnel->getSomething( getImplementationId_Static() ) ) : NULL );
+ return( xTunnel.is() ? reinterpret_cast< ::Graphic* >( xTunnel->getSomething( ::Graphic::getUnoTunnelId() ) ) : NULL );
}
//----------------------------------------------------------------------
sal_Int64 SAL_CALL Graphic::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw( uno::RuntimeException )
{
- return( ( rId.getLength() == 16 && 0 == rtl_compareMemory( getImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) ?
+ return( ( rId.getLength() == 16 && 0 == rtl_compareMemory( ::Graphic::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ?
reinterpret_cast< sal_Int64 >( mpGraphic ) :
0 );
}
diff --git a/svtools/source/graphic/graphic.hxx b/svtools/source/graphic/graphic.hxx
index a82c9cc..7b4f5e0 100644
--- a/svtools/source/graphic/graphic.hxx
+++ b/svtools/source/graphic/graphic.hxx
@@ -62,7 +62,6 @@ public:
void init( const ::Graphic& rGraphic ) throw();
static const ::Graphic* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
- static ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId_Static( ) throw(::com::sun::star::uno::RuntimeException);
static ::rtl::OUString getImplementationName_Static() throw();
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx
index 8373935..acb7271 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -40,6 +40,7 @@
#include <vcl/graph.h>
#include <vcl/gfxlink.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
namespace com { namespace sun { namespace star { namespace graphic { class XGraphic;} } } }
@@ -94,6 +95,7 @@ public:
SAL_DLLPRIVATE ImpGraphic* ImplGetImpGraphic() const { return mpImpGraphic; }
public:
+ static com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelId();
TYPEINFO();
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 1bb208b..8205a6b 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -42,6 +42,8 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <cppuhelper/typeprovider.hxx>
+#include <rtl/instance.hxx>
// -----------------------
// - Compression defines -
@@ -210,6 +212,16 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
// - Graphic -
// -----------
+namespace {
+
+struct Id: public rtl::Static< cppu::OImplementationId, Id > {};
+
+}
+
+uno::Sequence< sal_Int8 > Graphic::getUnoTunnelId() {
+ return Id::get().getImplementationId();
+}
+
TYPEINIT1_AUTOFACTORY( Graphic, SvDataCopyStream );
// ------------------------------------------------------------------------
@@ -266,9 +278,8 @@ Graphic::Graphic( const GDIMetaFile& rMtf )
Graphic::Graphic( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic )
{
uno::Reference< lang::XUnoTunnel > xTunnel( rxGraphic, uno::UNO_QUERY );
- uno::Reference< lang::XTypeProvider > xProv( rxGraphic, uno::UNO_QUERY );
- const ::Graphic* pGraphic = ( ( xTunnel.is() && xProv.is() ) ?
- reinterpret_cast< ::Graphic* >( xTunnel->getSomething( xProv->getImplementationId() ) ) :
+ const ::Graphic* pGraphic = ( xTunnel.is() ?
+ reinterpret_cast< ::Graphic* >( xTunnel->getSomething( getUnoTunnelId() ) ) :
NULL );
if( pGraphic )
commit 4209a6127d96c61295fad6e8f2c512644aadf850
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 15:43:58 2011 +0200
sb140: #i116872# avoid uninitialized RGB values for full-transparency pixels
plus
sb140: #i116872# optimize for nOpacity == 0 (requested by aw)
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 5b6536e..e2eca1b 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -62,9 +62,8 @@ namespace
if(nWidth && nHeight)
{
const Size aDestSize(nWidth, nHeight);
- sal_uInt8 nInitAlpha(255);
Bitmap aContent(aDestSize, 24);
- AlphaMask aAlpha(aDestSize, &nInitAlpha);
+ AlphaMask aAlpha(aDestSize);
BitmapWriteAccess* pContent = aContent.AcquireWriteAccess();
BitmapWriteAccess* pAlpha = aAlpha.AcquireWriteAccess();
@@ -99,14 +98,20 @@ namespace
}
nOpacity = nOpacity / nDivisor;
-
if(nOpacity)
{
pContent->SetPixel(y, x, BitmapColor(
(sal_uInt8)(nRed / nDivisor),
(sal_uInt8)(nGreen / nDivisor),
(sal_uInt8)(nBlue / nDivisor)));
- pAlpha->SetPixel(y, x, BitmapColor(255 - (sal_uInt8)nOpacity));
+ pAlpha->SetPixel(
+ y, x,
+ BitmapColor(255 - (sal_uInt8)nOpacity));
+ }
+ else
+ {
+ pContent->SetPixel(y, x, BitmapColor(0, 0, 0));
+ pAlpha->SetPixel(y, x, BitmapColor(255));
}
}
}
@@ -120,12 +125,8 @@ namespace
for(sal_uInt32 x(0L); x < nWidth; x++)
{
const basegfx::BPixel& rPixel(rRaster.getBPixel(nIndex++));
-
- if(rPixel.getOpacity())
- {
- pContent->SetPixel(y, x, BitmapColor(rPixel.getRed(), rPixel.getGreen(), rPixel.getBlue()));
- pAlpha->SetPixel(y, x, BitmapColor(255 - rPixel.getOpacity()));
- }
+ pContent->SetPixel(y, x, BitmapColor(rPixel.getRed(), rPixel.getGreen(), rPixel.getBlue()));
+ pAlpha->SetPixel(y, x, BitmapColor(255 - rPixel.getOpacity()));
}
}
}
commit fd652012ce85b9905c687e5490facba043f40a88
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 15:41:17 2011 +0200
sb140: #i117079# @executable_path -> @loader_path hack missed some instances
diff --git a/moz/extractfiles.mk b/moz/extractfiles.mk
index 1a8b80d..4741ff4 100644
--- a/moz/extractfiles.mk
+++ b/moz/extractfiles.mk
@@ -350,7 +350,14 @@ $(MISC)$/build$/so_moz_runtime_files: $(OUT)$/bin$/mozruntime.zip
.IF "$(OS)"=="MACOSX"
$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl extshl OOO \
$(RUNTIME_DIR)$/*$(DLLPOST)
-# A crude hack to adapt all the install names in the components subdir:
+# A crude hack to adapt all the absolute ("@executable_path") dependencies to
+# relative ("@loader_path") ones:
+ $(foreach,file,$(shell ls $(RUNTIME_DIR)$/components$/*$(DLLPOST)) \
+ install_name_tool \
+ -change @executable_path/libnspr4.dylib @loader_path/libnspr4.dylib \
+ -change @executable_path/libplc4.dylib @loader_path/libplc4.dylib \
+ -change @executable_path/libplds4.dylib @loader_path/libplds4.dylib \
+ $(file) &&) true
$(foreach,file,$(shell ls $(RUNTIME_DIR)$/components$/*$(DLLPOST)) \
install_name_tool \
-change @executable_path/libldap50.dylib \
@@ -373,6 +380,8 @@ $(MISC)$/build$/so_moz_runtime_files: $(OUT)$/bin$/mozruntime.zip
-change @executable_path/libxpcom.dylib @loader_path/../libxpcom.dylib \
-change @executable_path/libxpcom_compat.dylib \
@loader_path/../libxpcom_compat.dylib \
+ -change @executable_path/libxpcom_core.dylib \
+ @loader_path/../libxpcom_core.dylib \
$(file) &&) true
.ENDIF
commit 315e6ca2493d31aaedaea6747e2c39bc831a4e7f
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 15:00:24 2011 +0200
sb140: silence warnings
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index 19da7a8..90956bf 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -370,10 +370,10 @@ sal_Bool SAL_CALL uno_type_isAssignableFromData(
#define BINTEST_VERIFY( c ) \
if (! (c)) { fprintf( stderr, "### binary compatibility test failed: %s [line %d]!!!\n", #c, __LINE__ ); abort(); }
#define BINTEST_VERIFYOFFSET( s, m, n ) \
- if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %" SAL_PRI_SIZET "u instead of expected %d!!!\n", OFFSET_OF(s, m), n ); abort(); }
+ if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %" SAL_PRI_SIZET "u instead of expected %" SAL_PRI_SIZET "u!!!\n", OFFSET_OF(s, m), n ); abort(); }
#define BINTEST_VERIFYSIZE( s, n ) \
- if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %d instead of expected %d!!!\n", sizeof(s), n ); abort(); }
+ if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %" SAL_PRI_SIZET "u instead of expected %" SAL_PRI_SIZET "u!!!\n", sizeof(s), n ); abort(); }
struct C1
{
@@ -503,12 +503,12 @@ BinaryCompatible_Impl::BinaryCompatible_Impl()
(1 == 0) == sal_False );
#ifdef MAX_ALIGNMENT_4
// max alignment is 4
- BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, 4 );
- BINTEST_VERIFYSIZE( AlignSize_Impl, 12 );
+ BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, std::size_t(4) );
+ BINTEST_VERIFYSIZE( AlignSize_Impl, std::size_t(12) );
#else
// max alignment is 8
- BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, 8 );
- BINTEST_VERIFYSIZE( AlignSize_Impl, 16 );
+ BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, std::size_t(8) );
+ BINTEST_VERIFYSIZE( AlignSize_Impl, std::size_t(16) );
#endif
// sequence
@@ -518,7 +518,7 @@ BinaryCompatible_Impl::BinaryCompatible_Impl()
// any
BINTEST_VERIFY( sizeof(void *) >= sizeof(sal_Int32) );
BINTEST_VERIFY( sizeof( uno_Any ) == sizeof( void * ) * 3 );
- BINTEST_VERIFYOFFSET( uno_Any, pType, 0 );
+ BINTEST_VERIFYOFFSET( uno_Any, pType, std::size_t(0) );
BINTEST_VERIFYOFFSET( uno_Any, pData, 1 * sizeof (void *) );
BINTEST_VERIFYOFFSET( uno_Any, pReserved, 2 * sizeof (void *) );
// interface
@@ -526,69 +526,69 @@ BinaryCompatible_Impl::BinaryCompatible_Impl()
// string
BINTEST_VERIFY( sizeof( OUString ) == sizeof( rtl_uString * ) );
// struct
- BINTEST_VERIFYSIZE( M, 8 );
- BINTEST_VERIFYOFFSET( M, o, 4 );
- BINTEST_VERIFYSIZE( N, 12 );
- BINTEST_VERIFYOFFSET( N, p, 8 );
- BINTEST_VERIFYSIZE( N2, 12 );
- BINTEST_VERIFYOFFSET( N2, p, 8 );
+ BINTEST_VERIFYSIZE( M, std::size_t(8) );
+ BINTEST_VERIFYOFFSET( M, o, std::size_t(4) );
+ BINTEST_VERIFYSIZE( N, std::size_t(12) );
+ BINTEST_VERIFYOFFSET( N, p, std::size_t(8) );
+ BINTEST_VERIFYSIZE( N2, std::size_t(12) );
+ BINTEST_VERIFYOFFSET( N2, p, std::size_t(8) );
#ifdef MAX_ALIGNMENT_4
- BINTEST_VERIFYSIZE( O, 20 );
+ BINTEST_VERIFYSIZE( O, std::size_t(20) );
#else
- BINTEST_VERIFYSIZE( O, 24 );
+ BINTEST_VERIFYSIZE( O, std::size_t(24) );
#endif
- BINTEST_VERIFYSIZE( D, 8 );
- BINTEST_VERIFYOFFSET( D, e, 4 );
- BINTEST_VERIFYOFFSET( E, d, 4 );
- BINTEST_VERIFYOFFSET( E, e, 8 );
+ BINTEST_VERIFYSIZE( D, std::size_t(8) );
+ BINTEST_VERIFYOFFSET( D, e, std::size_t(4) );
+ BINTEST_VERIFYOFFSET( E, d, std::size_t(4) );
+ BINTEST_VERIFYOFFSET( E, e, std::size_t(8) );
- BINTEST_VERIFYSIZE( C1, 2 );
- BINTEST_VERIFYSIZE( C2, 8 );
- BINTEST_VERIFYOFFSET( C2, n2, 4 );
+ BINTEST_VERIFYSIZE( C1, std::size_t(2) );
+ BINTEST_VERIFYSIZE( C2, std::size_t(8) );
+ BINTEST_VERIFYOFFSET( C2, n2, std::size_t(4) );
#ifdef MAX_ALIGNMENT_4
- BINTEST_VERIFYSIZE( C3, 20 );
- BINTEST_VERIFYOFFSET( C3, d3, 8 );
- BINTEST_VERIFYOFFSET( C3, n3, 16 );
- BINTEST_VERIFYSIZE( C4, 32 );
- BINTEST_VERIFYOFFSET( C4, n4, 20 );
- BINTEST_VERIFYOFFSET( C4, d4, 24 );
- BINTEST_VERIFYSIZE( C5, 44 );
- BINTEST_VERIFYOFFSET( C5, n5, 32 );
- BINTEST_VERIFYOFFSET( C5, b5, 40 );
- BINTEST_VERIFYSIZE( C6, 52 );
- BINTEST_VERIFYOFFSET( C6, c6, 4 );
- BINTEST_VERIFYOFFSET( C6, b6, 48 );
-
- BINTEST_VERIFYSIZE( O2, 24 );
- BINTEST_VERIFYOFFSET( O2, p2, 20 );
+ BINTEST_VERIFYSIZE( C3, std::size_t(20) );
+ BINTEST_VERIFYOFFSET( C3, d3, std::size_t(8) );
+ BINTEST_VERIFYOFFSET( C3, n3, std::size_t(16) );
+ BINTEST_VERIFYSIZE( C4, std::size_t(32) );
+ BINTEST_VERIFYOFFSET( C4, n4, std::size_t(20) );
+ BINTEST_VERIFYOFFSET( C4, d4, std::size_t(24) );
+ BINTEST_VERIFYSIZE( C5, std::size_t(44) );
+ BINTEST_VERIFYOFFSET( C5, n5, std::size_t(32) );
+ BINTEST_VERIFYOFFSET( C5, b5, std::size_t(40) );
+ BINTEST_VERIFYSIZE( C6, std::size_t(52) );
+ BINTEST_VERIFYOFFSET( C6, c6, std::size_t(4) );
+ BINTEST_VERIFYOFFSET( C6, b6, std::size_t(48) );
+
+ BINTEST_VERIFYSIZE( O2, std::size_t(24) );
+ BINTEST_VERIFYOFFSET( O2, p2, std::size_t(20) );
#else
- BINTEST_VERIFYSIZE( C3, 24 );
- BINTEST_VERIFYOFFSET( C3, d3, 8 );
- BINTEST_VERIFYOFFSET( C3, n3, 16 );
- BINTEST_VERIFYSIZE( C4, 40 );
- BINTEST_VERIFYOFFSET( C4, n4, 24 );
- BINTEST_VERIFYOFFSET( C4, d4, 32 );
- BINTEST_VERIFYSIZE( C5, 56 );
- BINTEST_VERIFYOFFSET( C5, n5, 40 );
- BINTEST_VERIFYOFFSET( C5, b5, 48 );
- BINTEST_VERIFYSIZE( C6, 72 );
- BINTEST_VERIFYOFFSET( C6, c6, 8 );
- BINTEST_VERIFYOFFSET( C6, b6, 64 );
-
- BINTEST_VERIFYSIZE( O2, 32 );
- BINTEST_VERIFYOFFSET( O2, p2, 24 );
+ BINTEST_VERIFYSIZE( C3, std::size_t(24) );
+ BINTEST_VERIFYOFFSET( C3, d3, std::size_t(8) );
+ BINTEST_VERIFYOFFSET( C3, n3, std::size_t(16) );
+ BINTEST_VERIFYSIZE( C4, std::size_t(40) );
+ BINTEST_VERIFYOFFSET( C4, n4, std::size_t(24) );
+ BINTEST_VERIFYOFFSET( C4, d4, std::size_t(32) );
+ BINTEST_VERIFYSIZE( C5, std::size_t(56) );
+ BINTEST_VERIFYOFFSET( C5, n5, std::size_t(40) );
+ BINTEST_VERIFYOFFSET( C5, b5, std::size_t(48) );
+ BINTEST_VERIFYSIZE( C6, std::size_t(72) );
+ BINTEST_VERIFYOFFSET( C6, c6, std::size_t(8) );
+ BINTEST_VERIFYOFFSET( C6, b6, std::size_t(64) );
+
+ BINTEST_VERIFYSIZE( O2, std::size_t(32) );
+ BINTEST_VERIFYOFFSET( O2, p2, std::size_t(24) );
#endif
- BINTEST_VERIFYSIZE( Char3, 3 );
- BINTEST_VERIFYOFFSET( Char4, c, 3 );
+ BINTEST_VERIFYSIZE( Char3, std::size_t(3) );
+ BINTEST_VERIFYOFFSET( Char4, c, std::size_t(3) );
#ifdef MAX_ALIGNMENT_4
// max alignment is 4
- BINTEST_VERIFYSIZE( P, 20 );
+ BINTEST_VERIFYSIZE( P, std::size_t(20) );
#else
// alignment of P is 8, because of P[] ...
- BINTEST_VERIFYSIZE( P, 24 );
+ BINTEST_VERIFYSIZE( P, std::size_t(24) );
BINTEST_VERIFYSIZE( second, sizeof( int ) );
#endif
}
commit e75cd93855771ef07c61e5915ffe509384eef28f
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 14:52:21 2011 +0200
sb140: #i117085# support ENABLE_SYMBOLS
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 81148a9..55f2f1f 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -84,6 +84,11 @@ gb_CXXFLAGS := \
+w2 \
-erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype \
+ifeq ($(gb_SYMBOL),$(true))
+gb_CFLAGS += -g -xs
+gb_CXXFLAGS += -g0 -xs
+endif
+
ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
gb_CFLAGS_WERROR := -errwarn=%all
gb_CXXFLAGS_WERROR := -xwe
commit 1d38dbab29245e430792f7b3a4c14c94cd011504
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 14:41:53 2011 +0200
sb140: #i117084# do not leak Lockfile instance
plus improvements based on a14010cb8c485ee1d07530d34a00f03db3233e02 "valgrind: fix leak"
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index f4b00f5..10f6de9 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -31,6 +31,7 @@
// stl includes first
#include <map>
+#include <memory>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <vcl/svapp.hxx>
#include <vcl/timer.hxx>
@@ -205,7 +206,7 @@ class Desktop : public Application
BootstrapError m_aBootstrapError;
BootstrapStatus m_aBootstrapStatus;
- Lockfile *m_pLockfile;
+ std::auto_ptr< Lockfile > m_pLockfile;
Timer m_firstRunTimer;
static ResMgr* pResMgr;
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index efe2038..bf48647 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -676,7 +676,6 @@ throw()
Desktop::Desktop()
: m_bServicesRegistered( false )
, m_aBootstrapError( BE_OK )
-, m_pLockfile( NULL )
{
RTL_LOGFILE_TRACE( "desktop (cd100003) ::Desktop::Desktop" );
}
@@ -797,11 +796,7 @@ void Desktop::DeInit()
::comphelper::setProcessServiceFactory( NULL );
// clear lockfile
- if (m_pLockfile != NULL)
- {
- delete m_pLockfile;
- m_pLockfile = NULL;
- }
+ m_pLockfile.reset();
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
@@ -862,12 +857,7 @@ sal_Bool Desktop::QueryExit()
{
}
- if (m_pLockfile != NULL)
- {
- delete m_pLockfile;
- m_pLockfile = NULL;
- }
-
+ m_pLockfile.reset();
}
return bExit;
@@ -1482,11 +1472,7 @@ sal_uInt16 Desktop::Exception(sal_uInt16 nError)
default:
{
- if (m_pLockfile != NULL)
- {
- delete m_pLockfile;
- m_pLockfile = NULL;
- }
+ m_pLockfile.reset();
if( bRestart )
{
@@ -1633,7 +1619,7 @@ int Desktop::Main()
// check user installation directory for lockfile so we can be sure
// there is no other instance using our data files from a remote host
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
- m_pLockfile = new Lockfile;
+ m_pLockfile.reset( new Lockfile );
if ( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsInvisible() &&
!rCmdLineArgs.IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning ))
{
diff --git a/desktop/source/app/lockfile.cxx b/desktop/source/app/lockfile.cxx
index 72632bd..98ddb7f 100644
--- a/desktop/source/app/lockfile.cxx
+++ b/desktop/source/app/lockfile.cxx
@@ -210,15 +210,6 @@ namespace desktop {
aConfig.Flush( );
}
- void Lockfile::clean( void )
- {
- if ( m_bRemove )
- {
- File::remove( m_aLockname );
- m_bRemove = sal_False;
- }
- }
-
Lockfile::~Lockfile( void )
{
// unlock userdata by removing file
diff --git a/desktop/source/app/lockfile.hxx b/desktop/source/app/lockfile.hxx
index 5444714..75a61d6 100644
--- a/desktop/source/app/lockfile.hxx
+++ b/desktop/source/app/lockfile.hxx
@@ -73,9 +73,6 @@ namespace desktop {
// found (iff gui) and returns false when we may not continue
sal_Bool check( fpExecWarning execWarning );
- // removes the lockfile. should only be called in exceptional situations
- void clean(void);
-
// removes the lockfile
~Lockfile(void);
commit 21d97438e2944861e26e4984195f959a0cce1e41
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 9 14:03:27 2011 +0200
sb140: #i117082# avoid unncessary static class data members (which are destroyed too late)
plus
sb140: #i117082# extra indirections to apeace MSC
sb140: #i117082# avoid warnings about not intializing boost::noncopyable base in copy ctors
diff --git a/editeng/inc/editeng/unopracc.hxx b/editeng/inc/editeng/unopracc.hxx
index c1e57ed..99b82cb 100644
--- a/editeng/inc/editeng/unopracc.hxx
+++ b/editeng/inc/editeng/unopracc.hxx
@@ -40,9 +40,7 @@ class SvxEditSource;
XMultiPropertySet interfaces. Just set the selection to the
required text range and return a reference to a XPropertySet.
*/
-class SvxAccessibleTextPropertySet : public SvxUnoTextRangeBase,
- public ::com::sun::star::lang::XTypeProvider,
- public ::cppu::OWeakObject
+class SvxAccessibleTextPropertySet : public SvxUnoTextRangeBase
{
public:
SvxAccessibleTextPropertySet( const SvxEditSource*, const SvxItemPropertySet* );
@@ -51,21 +49,11 @@ public:
// XTextRange
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
- // uno::XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
// lang::XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
- // lang::XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
// XServiceName
::rtl::OUString SAL_CALL getServiceName() throw (::com::sun::star::uno::RuntimeException);
};
diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx
index bdf86be..2db3bd2 100644
--- a/editeng/inc/editeng/unotext.hxx
+++ b/editeng/inc/editeng/unotext.hxx
@@ -29,13 +29,15 @@
#ifndef _SVX_UNOTEXT_HXX
#define _SVX_UNOTEXT_HXX
+#include "sal/config.h"
+
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/text/XTextRangeMover.hpp>
+#include <com/sun/star/text/XTextContent.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -53,6 +55,10 @@
#include <com/sun/star/style/TabStop.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/text/XTextRange.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase8.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/weakagg.hxx>
@@ -250,16 +256,20 @@ namespace accessibility
}
// ====================================================================
-class EDITENG_DLLPUBLIC SvxUnoTextRangeBase : public ::com::sun::star::text::XTextRange,
- public ::com::sun::star::beans::XPropertySet,
- public ::com::sun::star::beans::XMultiPropertySet,
- public ::com::sun::star::beans::XMultiPropertyStates,
- public ::com::sun::star::beans::XPropertyState,
- public ::com::sun::star::lang::XServiceInfo,
- public ::com::sun::star::text::XTextRangeCompare,
- public ::com::sun::star::lang::XUnoTunnel,
+typedef
+ cppu::WeakAggImplHelper8<
+ ::com::sun::star::text::XTextRange,
+ ::com::sun::star::beans::XPropertySet,
+ ::com::sun::star::beans::XMultiPropertySet,
+ ::com::sun::star::beans::XMultiPropertyStates,
+ ::com::sun::star::beans::XPropertyState,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::text::XTextRangeCompare,
+ ::com::sun::star::lang::XUnoTunnel >
+ SvxUnoTextRangeBase_Base;
+
+class EDITENG_DLLPUBLIC SvxUnoTextRangeBase : public SvxUnoTextRangeBase_Base,
private osl::DebugBase<SvxUnoTextRangeBase>
-
{
friend class SvxUnoTextRangeEnumeration;
friend class accessibility::AccessibleEditableTextPara;
@@ -364,9 +374,7 @@ public:
// ====================================================================
class SvxUnoTextBase;
-class EDITENG_DLLPUBLIC SvxUnoTextRange : public SvxUnoTextRangeBase,
- public ::com::sun::star::lang::XTypeProvider,
- public ::cppu::OWeakAggObject
+class EDITENG_DLLPUBLIC SvxUnoTextRange : public SvxUnoTextRangeBase
{
friend class SvxUnoTextRangeEnumeration;
private:
@@ -377,29 +385,37 @@ public:
SvxUnoTextRange( const SvxUnoTextBase& rParent, sal_Bool bPortion = sal_False ) throw();
virtual ~SvxUnoTextRange() throw();
- // ::com::sun::star::uno::XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
// ::com::sun::star::text::XTextRange
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+};
- // ::com::sun::star::lang::XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+typedef
+ cppu::AggImplInheritanceHelper4<
+ SvxUnoTextRangeBase,
+ ::com::sun::star::text::XTextAppend,
+ ::com::sun::star::text::XTextCopy,
+ ::com::sun::star::container::XEnumerationAccess,
+ ::com::sun::star::text::XTextRangeMover >
+ SvxUnoTextBase_Base0;
+
+// Extra indirection to keep MSC from trying to (unsuccessfully) fully
+// instantiate a non-DLLPUBLIC template base class of a DLLPUBLIC class:
+class SvxUnoTextBase_Base: public SvxUnoTextBase_Base0 {
+protected:
+ explicit SvxUnoTextBase_Base(SvxUnoTextBase_Base const &) throw ();
+ explicit SvxUnoTextBase_Base(SvxItemPropertySet const * set) throw ();
+ SvxUnoTextBase_Base(
+ SvxEditSource const * source, SvxItemPropertySet const * set) throw ();
+ virtual ~SvxUnoTextBase_Base() throw ();
+
+private:
+ void operator =(SvxUnoTextBase_Base const &); // not defined
};
-class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextRangeBase,
- public ::com::sun::star::text::XTextAppend,
- public ::com::sun::star::text::XTextCopy,
- public ::com::sun::star::container::XEnumerationAccess,
- public ::com::sun::star::text::XTextRangeMover,
- public ::com::sun::star::lang::XTypeProvider
+class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextBase_Base
{
protected:
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
@@ -415,13 +431,9 @@ public:
UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
ESelection InsertField( const SvxFieldItem& rField ) throw();
- static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getStaticTypes() throw();
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createTextCursorBySelection( const ESelection& rSel );
- // ::com::sun::star::uno::XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::text::XSimpleText
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw(::com::sun::star::uno::RuntimeException);
@@ -463,15 +475,10 @@ public:
virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static( ) SAL_THROW(());
-
- // ::com::sun::star::lang::XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
};
// ====================================================================
-class EDITENG_DLLPUBLIC SvxUnoText : public SvxUnoTextBase,
- public ::cppu::OWeakAggObject
+class EDITENG_DLLPUBLIC SvxUnoText : public SvxUnoTextBase
{
public:
SvxUnoText( ) throw();
@@ -482,16 +489,6 @@ public:
// Internal
UNO3_GETIMPLEMENTATION_DECL( SvxUnoText )
-
- // ::com::sun::star::uno::XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // ::com::sun::star::lang::XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
};
// ====================================================================
@@ -516,13 +513,15 @@ public:
};
// ====================================================================
-#include <com/sun/star/text/XTextContent.hpp>
-class SvxUnoTextContent : public SvxUnoTextRangeBase,
- public ::com::sun::star::text::XTextContent,
- public ::com::sun::star::container::XEnumerationAccess,
- public ::com::sun::star::lang::XTypeProvider,
- public ::cppu::OWeakAggObject
+typedef
+ cppu::AggImplInheritanceHelper2<
+ SvxUnoTextRangeBase,
+ ::com::sun::star::text::XTextContent,
+ ::com::sun::star::container::XEnumerationAccess >
+ SvxUnoTextContent_Base;
+
+class SvxUnoTextContent : public SvxUnoTextContent_Base
{
friend class SvxUnoTextContentEnumeration;
private:
@@ -545,12 +544,6 @@ public:
SvxUnoTextContent( const SvxUnoTextContent& rContent ) throw();
virtual ~SvxUnoTextContent() throw();
- // ::com::sun::star::uno::XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
// ::com::sun::star::text::XTextRange
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException);
@@ -586,10 +579,6 @@ public:
// ::com::sun::star::lang::XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::lang::XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
};
// ====================================================================
@@ -615,10 +604,25 @@ public:
// ====================================================================
-class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextRangeBase,
- public ::com::sun::star::text::XTextCursor,
- public ::com::sun::star::lang::XTypeProvider,
- public ::cppu::OWeakAggObject
+typedef
+ cppu::AggImplInheritanceHelper1<
+ SvxUnoTextRangeBase,
+ ::com::sun::star::text::XTextCursor >
+ SvxUnoTextCursor_Base0;
+
+// Extra indirection to keep MSC from trying to (unsuccessfully) fully
+// instantiate a non-DLLPUBLIC template base class of a DLLPUBLIC class:
+class SvxUnoTextCursor_Base: public SvxUnoTextCursor_Base0 {
+protected:
+ explicit SvxUnoTextCursor_Base(SvxUnoTextCursor_Base const & base) throw ();
+ explicit SvxUnoTextCursor_Base(SvxUnoTextRangeBase const & base) throw ();
+ virtual ~SvxUnoTextCursor_Base() throw ();
+
+private:
+ void operator =(SvxUnoTextCursor_Base const &); // not defined
+};
+
+class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextCursor_Base
{
private:
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
@@ -628,12 +632,6 @@ public:
SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) throw();
virtual ~SvxUnoTextCursor() throw();
- // ::com::sun::star::uno::XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
// ::com::sun::star::text::XTextRange
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
@@ -655,11 +653,6 @@ public:
virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::lang::XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
-
};
EDITENG_DLLPUBLIC const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet();
diff --git a/editeng/source/uno/unopracc.cxx b/editeng/source/uno/unopracc.cxx
index 088cdbb..71ba24c 100644
--- a/editeng/source/uno/unopracc.cxx
+++ b/editeng/source/uno/unopracc.cxx
@@ -75,70 +75,6 @@ uno::Reference< text::XText > SAL_CALL SvxAccessibleTextPropertySet::getText() t
return uno::Reference< text::XText > ();
}
-uno::Any SAL_CALL SvxAccessibleTextPropertySet::queryAggregation( const uno::Type & ) throw(uno::RuntimeException)
-{
- // TODO (empty?)
- return uno::Any();
-}
-
-uno::Any SAL_CALL SvxAccessibleTextPropertySet::queryInterface( const uno::Type & rType )
- throw(uno::RuntimeException)
-{
- return OWeakObject::queryInterface(rType);
-}
-
-void SAL_CALL SvxAccessibleTextPropertySet::acquire()
- throw()
-{
- OWeakObject::acquire();
-}
-
-void SAL_CALL SvxAccessibleTextPropertySet::release()
- throw()
-{
- OWeakObject::release();
-}
-
-// XTypeProvider
-uno::Sequence< uno::Type > SAL_CALL SvxAccessibleTextPropertySet::getTypes() throw ( uno::RuntimeException )
-{
- static ::cppu::OTypeCollection* pTypeCollection = NULL ;
-
- // double-checked locking pattern.
- if ( pTypeCollection == NULL )
- {
- osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
-
- // Control these pointer again ... it can be, that another instance will be faster then these!
- if ( pTypeCollection == NULL )
- {
- // Create a static typecollection ...
- static ::cppu::OTypeCollection aTypeCollection(
- ::getCppuType( static_cast< const uno::Reference< beans::XPropertySet >* > (0) ),
- ::getCppuType( static_cast< const uno::Reference< beans::XMultiPropertySet >* > (0) ),
- ::getCppuType( static_cast< const uno::Reference< beans::XPropertyState >* > (0) ),
- ::getCppuType( static_cast< const uno::Reference< lang::XServiceInfo >* > (0) ),
- ::getCppuType( static_cast< const uno::Reference< lang::XTypeProvider >* > (0) ) );
-
- // ... and set his address to static pointer!
- pTypeCollection = &aTypeCollection ;
- }
- }
-
- return pTypeCollection->getTypes() ;
-}
-
-namespace
-{
- class theSvxAccessibleTextPropertySetImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxAccessibleTextPropertySetImplementationId > {};
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL SvxAccessibleTextPropertySet::getImplementationId()
- throw (uno::RuntimeException)
-{
- return theSvxAccessibleTextPropertySetImplementationId::get().getSeq();
-}
-
// XServiceInfo
::rtl::OUString SAL_CALL SAL_CALL SvxAccessibleTextPropertySet::getImplementationName (void) throw (uno::RuntimeException)
{
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 680b0f9..627f94b 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -60,10 +60,6 @@ using namespace ::rtl;
using namespace ::cppu;
using namespace ::com::sun::star;
-#define QUERYINT( xint ) \
- if( rType == ::getCppuType((const uno::Reference< xint >*)0) ) \
- return uno::makeAny(uno::Reference< xint >(this))
-
const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet()
{
static SvxItemPropertySet aTextCursorSvxPropertySet( ImplGetSvxUnoOutlinerTextCursorPropertyMap(), EditEngine::GetGlobalItemPool() );
@@ -217,14 +213,7 @@ SvxUnoTextRangeBase::SvxUnoTextRangeBase( const SvxEditSource* pSource, const Sv
}
SvxUnoTextRangeBase::SvxUnoTextRangeBase( const SvxUnoTextRangeBase& rRange ) throw()
-: text::XTextRange()
-, beans::XPropertySet()
-, beans::XMultiPropertySet()
-, beans::XMultiPropertyStates()
-, beans::XPropertyState()
-, lang::XServiceInfo()
-, text::XTextRangeCompare()
-, lang::XUnoTunnel()
+: SvxUnoTextRangeBase_Base()
, mpPropSet(rRange.getPropertySet())
{
SolarMutexGuard aGuard;
@@ -1545,89 +1534,6 @@ SvxUnoTextRange::~SvxUnoTextRange() throw()
{
}
-uno::Any SAL_CALL SvxUnoTextRange::queryAggregation( const uno::Type & rType )
- throw(uno::RuntimeException)
-{
- QUERYINT( text::XTextRange );
- else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertyStates >*)0) )
- return uno::makeAny(uno::Reference< beans::XMultiPropertyStates >(this));
- else if( rType == ::getCppuType((const uno::Reference< beans::XPropertySet >*)0) )
- return uno::makeAny(uno::Reference< beans::XPropertySet >(this));
- else QUERYINT( beans::XPropertyState );
- else QUERYINT( text::XTextRangeCompare );
- else if( rType == ::getCppuType((const uno::Reference< beans::XMultiPropertySet >*)0) )
- return uno::makeAny(uno::Reference< beans::XMultiPropertySet >(this));
- else QUERYINT( lang::XServiceInfo );
- else QUERYINT( lang::XTypeProvider );
- else QUERYINT( lang::XUnoTunnel );
- else
- return OWeakAggObject::queryAggregation( rType );
-}
-
-uno::Any SAL_CALL SvxUnoTextRange::queryInterface( const uno::Type & rType )
- throw(uno::RuntimeException)
-{
- return OWeakAggObject::queryInterface(rType);
-}
-
-void SAL_CALL SvxUnoTextRange::acquire()
- throw( )
-{
- OWeakAggObject::acquire();
-}
-
-void SAL_CALL SvxUnoTextRange::release()
- throw( )
-{
- OWeakAggObject::release();
-}
-
-// XTypeProvider
-
-namespace
-{
- struct theSvxUnoTextRangeTypes :
- public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextRangeTypes>
- {
- uno::Sequence<uno::Type> operator () ()
- {
- uno::Sequence< uno::Type > aTypeSequence;
-
- aTypeSequence.realloc( 9 ); // !DANGER! keep this updated
- uno::Type* pTypes = aTypeSequence.getArray();
-
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
-
- return aTypeSequence;
- }
- };
-}
-
-uno::Sequence< uno::Type > SAL_CALL SvxUnoTextRange::getTypes()
- throw (uno::RuntimeException)
-{
- return theSvxUnoTextRangeTypes::get();
-}
-
-namespace
-{
- class theSvxUnoTextRangeImplementationId : public rtl::Static< UnoTunnelIdInit, theSvxUnoTextRangeImplementationId > {};
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextRange::getImplementationId()
- throw (uno::RuntimeException)
-{
- return theSvxUnoTextRangeImplementationId::get().getSeq();
-}
-
// XTextRange
uno::Reference< text::XText > SAL_CALL SvxUnoTextRange::getText()
throw(uno::RuntimeException)
@@ -1646,19 +1552,36 @@ OUString SAL_CALL SvxUnoTextRange::getImplementationName()
// class SvxUnoText
// ====================================================================
+SvxUnoTextBase_Base::SvxUnoTextBase_Base(SvxUnoTextBase_Base const & base)
+ throw ():
+ SvxUnoTextBase_Base0(base)
+{}
+
+SvxUnoTextBase_Base::SvxUnoTextBase_Base(SvxItemPropertySet const * set)
+ throw ():
+ SvxUnoTextBase_Base0(set)
+{}
+
+SvxUnoTextBase_Base::SvxUnoTextBase_Base(
+ SvxEditSource const * source, SvxItemPropertySet const * set) throw ():
+ SvxUnoTextBase_Base0(source, set)
+{}
+
+SvxUnoTextBase_Base::~SvxUnoTextBase_Base() throw () {}
+
SvxUnoTextBase::SvxUnoTextBase() throw()
-: SvxUnoTextRangeBase( NULL )
+: SvxUnoTextBase_Base( static_cast< SvxItemPropertySet * >(NULL) )
{
}
SvxUnoTextBase::SvxUnoTextBase( const SvxItemPropertySet* _pSet ) throw()
-: SvxUnoTextRangeBase( _pSet )
+: SvxUnoTextBase_Base( _pSet )
{
}
SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet ) throw()
-: SvxUnoTextRangeBase( pSource, _pSet )
+: SvxUnoTextBase_Base( pSource, _pSet )
{
ESelection aSelection;
::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
@@ -1666,7 +1589,7 @@ SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPrope
}
SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* _pSet, uno::Reference < text::XText > xParent ) throw()
-: SvxUnoTextRangeBase( pSource, _pSet )
+: SvxUnoTextBase_Base( pSource, _pSet )
{
xParentText = xParent;
ESelection aSelection;
@@ -1675,12 +1598,7 @@ SvxUnoTextBase::SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPrope
}
SvxUnoTextBase::SvxUnoTextBase( const SvxUnoTextBase& rText ) throw()
-: SvxUnoTextRangeBase( rText )
-, text::XTextAppend()
-, text::XTextCopy()
-, container::XEnumerationAccess()
-, text::XTextRangeMover()
-, lang::XTypeProvider()
+: SvxUnoTextBase_Base( rText )
{
xParentText = rText.xParentText;
}
@@ -1708,89 +1626,6 @@ ESelection SvxUnoTextBase::InsertField( const SvxFieldItem& rField ) throw()
return GetSelection(); // Selection with the field
}
-// XInterface
-uno::Any SAL_CALL SvxUnoTextBase::queryAggregation( const uno::Type & rType )
- throw(uno::RuntimeException)
-{
- QUERYINT( text::XText );
- QUERYINT( text::XSimpleText );
- if( rType == ::getCppuType((const uno::Reference< text::XTextRange >*)0) )
- return uno::makeAny(uno::Reference< text::XTextRange >((text::XText*)(this)));
- QUERYINT(container::XEnumerationAccess );
- QUERYINT( container::XElementAccess );
- QUERYINT( beans::XMultiPropertyStates );
- QUERYINT( beans::XPropertySet );
- QUERYINT( beans::XMultiPropertySet );
- QUERYINT( beans::XPropertyState );
- QUERYINT( text::XTextRangeCompare );
- QUERYINT( lang::XServiceInfo );
- QUERYINT( text::XTextRangeMover );
- QUERYINT( text::XTextCopy );
- QUERYINT( text::XTextAppend );
- QUERYINT( text::XParagraphAppend );
- QUERYINT( text::XTextPortionAppend );
- QUERYINT( lang::XTypeProvider );
- QUERYINT( lang::XUnoTunnel );
-
- return uno::Any();
-}
-
-// XTypeProvider
-
-namespace
-{
- struct theSvxUnoTextBaseTypes :
- public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextBaseTypes>
- {
- uno::Sequence<uno::Type> operator () ()
- {
- uno::Sequence< uno::Type > aTypeSequence;
-
- aTypeSequence.realloc( 15 ); // !DANGER! keep this updated
- uno::Type* pTypes = aTypeSequence.getArray();
-
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XText >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeMover >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextAppend >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCopy >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XParagraphAppend >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextPortionAppend >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
- *pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
-
- return aTypeSequence;
- }
- };
-}
-uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getStaticTypes() throw()
-{
- return theSvxUnoTextBaseTypes::get();
-}
-
-uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getTypes()
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list