INTEGRATION: CWS jl31 (1.21.14); FILE MERGED

2006/02/20 16:00:30 sb 1.21.14.1: #i62339# Introduced (internal-only) cppu::getTypeFavourUnsigned as (working) replacement of now deprecated getCppuType<> template.
This commit is contained in:
Rüdiger Timm
2006-03-09 09:44:31 +00:00
parent 36e55b1bee
commit 6d94da0a6a

View File

@@ -4,9 +4,9 @@
*
* $RCSfile: Sequence.hxx,v $
*
* $Revision: 1.21 $
* $Revision: 1.22 $
*
* last change: $Author: rt $ $Date: 2006-01-10 15:53:33 $
* last change: $Author: rt $ $Date: 2006-03-09 10:44:31 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -259,6 +259,23 @@ getTypeFavourUnsigned(::com::sun::star::uno::Sequence< T > const *) {
&::com::sun::star::uno::Sequence< T >::s_pType);
}
template< typename T > inline ::com::sun::star::uno::Type const &
getTypeFavourChar(::com::sun::star::uno::Sequence< T > const *) {
//TODO On certain platforms with weak memory models, the following code can
// result in some threads observing that td points to garbage:
static typelib_TypeDescriptionReference * td = 0;
if (td == 0) {
::typelib_static_sequence_type_init(
&td,
(::cppu::getTypeFavourChar(
static_cast<
typename ::com::sun::star::uno::Sequence< T >::ElementType * >(
0)).
getTypeLibType()));
}
return detail::getTypeFromTypeDescriptionReference(&td);
}
}
// generic sequence template