1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tdmgr_check.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_stoc.hxx"
34 #include "tdmgr_common.hxx"
35 #include "rtl/ustrbuf.hxx"
36 #include "typelib/typedescription.h"
37 #include "com/sun/star/beans/PropertyAttribute.hpp"
38 #include "com/sun/star/reflection/XConstantsTypeDescription.hpp"
39 #include "com/sun/star/reflection/XIndirectTypeDescription.hpp"
40 #include "com/sun/star/reflection/XEnumTypeDescription.hpp"
41 #include "com/sun/star/reflection/XStructTypeDescription.hpp"
42 #include "com/sun/star/reflection/XInterfaceTypeDescription2.hpp"
43 #include "com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp"
44 #include "com/sun/star/reflection/XInterfaceAttributeTypeDescription2.hpp"
45 #include "com/sun/star/reflection/XServiceTypeDescription2.hpp"
46 #include "com/sun/star/reflection/XSingletonTypeDescription2.hpp"
49 using ::rtl::OUString
;
50 using ::rtl::OUStringBuffer
;
51 using namespace ::com::sun::star
;
52 using namespace ::com::sun::star::uno
;
53 using namespace ::stoc_tdmgr
;
57 OUString
getTypeClassName( TypeClass tc
)
59 typelib_EnumTypeDescription
* typeDescr
= 0;
60 OUString name
= OUSTR("com.sun.star.uno.TypeClass");
61 typelib_typedescription_getByName(
62 reinterpret_cast<typelib_TypeDescription
**>(&typeDescr
), name
.pData
);
63 OSL_ASSERT( typeDescr
!= 0 );
65 return OUSTR("Cannot get type description of ") + name
;
66 typelib_typedescription_complete(
67 reinterpret_cast<typelib_TypeDescription
**>(&typeDescr
) );
69 sal_Int32
const * pValues
= typeDescr
->pEnumValues
;
70 sal_Int32 nPos
= typeDescr
->nEnumValues
;
73 if (pValues
[ nPos
] == (sal_Int32
) tc
)
77 name
= typeDescr
->ppEnumNames
[ nPos
];
79 name
= OUSTR("unknown TypeClass value: ") +
80 OUString::valueOf( (sal_Int32
) tc
);
82 typelib_typedescription_release(
83 reinterpret_cast<typelib_TypeDescription
*>(typeDescr
) );
87 OUString
getPropertyFlagsAsString( sal_Int16 attributes
)
90 if ((attributes
& beans::PropertyAttribute::MAYBEVOID
) != 0)
91 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("MAYBEVOID, ") );
92 if ((attributes
& beans::PropertyAttribute::BOUND
) != 0)
93 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("BOUND, ") );
94 if ((attributes
& beans::PropertyAttribute::CONSTRAINED
) != 0)
95 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("CONSTRAINED, ") );
96 if ((attributes
& beans::PropertyAttribute::TRANSIENT
) != 0)
97 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("TRANSIENT, ") );
98 if ((attributes
& beans::PropertyAttribute::READONLY
) != 0)
99 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("READONLY, ") );
100 if ((attributes
& beans::PropertyAttribute::MAYBEAMBIGUOUS
) != 0)
101 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("MAYBEAMBIGUOUS, ") );
102 if ((attributes
& beans::PropertyAttribute::MAYBEDEFAULT
) != 0)
103 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("MAYBEDEFAULT, ") );
104 if ((attributes
& beans::PropertyAttribute::REMOVEABLE
) != 0)
105 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("REMOVEABLE, ") );
106 if ((attributes
& beans::PropertyAttribute::OPTIONAL
) != 0)
107 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("OPTIONAL") );
108 else if (buf
.getLength() > 0)
109 buf
.setLength( buf
.getLength() - 2 ); // truncate ", "
110 return buf
.makeStringAndClear();
113 void typeError( OUString
const & msg
, OUString
const & context
)
116 if (context
.getLength() > 0) {
117 buf
.append( static_cast<sal_Unicode
>('[') );
118 buf
.append( context
);
119 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("] ") );
122 throw IncompatibleTypeException( buf
.makeStringAndClear() );
126 void checkSeq( Sequence
< Reference
<T
> > const & newTypes
,
127 Sequence
< Reference
<T
> > const & existingTypes
,
128 OUString
const & context
,
129 bool optionalMode
= false )
131 sal_Int32 len
= newTypes
.getLength();
132 if (len
!= existingTypes
.getLength())
134 if (!optionalMode
|| len
< newTypes
.getLength())
135 typeError( OUSTR("Different number of types!"), context
);
136 len
= existingTypes
.getLength();
139 Reference
<T
> const * pNewTypes
= newTypes
.getConstArray();
140 Reference
<T
> const * pExistingTypes
= existingTypes
.getConstArray();
141 for ( sal_Int32 pos
= 0; pos
< len
; ++pos
)
144 buf
.append( context
);
145 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(", position ") );
147 check( pNewTypes
[pos
].get(), pExistingTypes
[pos
].get(),
148 buf
.makeStringAndClear() );
153 Reference
<reflection::XEnumTypeDescription
> const & xNewTD
,
154 Reference
<reflection::XEnumTypeDescription
> const & xExistingTD
)
156 if (xNewTD
->getEnumNames() != xExistingTD
->getEnumNames())
157 typeError( OUSTR("ENUM names don't match!"), xNewTD
->getName() );
158 if (xNewTD
->getEnumValues() != xExistingTD
->getEnumValues())
159 typeError( OUSTR("ENUM values don't match!"), xNewTD
->getName() );
163 Reference
<reflection::XCompoundTypeDescription
> const & xNewTD
,
164 Reference
<reflection::XCompoundTypeDescription
> const & xExistingTD
)
166 check( xNewTD
->getBaseType(), xExistingTD
->getBaseType(),
167 xNewTD
->getName() + OUSTR(", base type") );
168 checkSeq( xNewTD
->getMemberTypes(), xExistingTD
->getMemberTypes(),
169 xNewTD
->getName() + OUSTR(", member types") );
171 if (xNewTD
->getMemberNames() != xExistingTD
->getMemberNames())
172 typeError( OUSTR("Different member names!"), xNewTD
->getName() );
174 if (xNewTD
->getTypeClass() == TypeClass_STRUCT
)
176 Reference
<reflection::XStructTypeDescription
> xNewStructTD(
178 Reference
<reflection::XStructTypeDescription
> xExistingStructTD(
179 xExistingTD
, UNO_QUERY
);
180 if (xNewStructTD
.is() && xExistingStructTD
.is())
182 if (xNewStructTD
->getTypeParameters() !=
183 xExistingStructTD
->getTypeParameters())
184 typeError( OUSTR("Different type parameters of instantiated "
185 "polymorphic STRUCT!"), xNewTD
->getName() );
186 checkSeq( xNewStructTD
->getTypeArguments(),
187 xExistingStructTD
->getTypeArguments(),
188 xNewTD
->getName() + OUSTR(", argument types") );
190 else if (xNewStructTD
.is() || xExistingStructTD
.is())
191 typeError( OUSTR("Mixing polymorphic STRUCT types "
192 "with non-polymorphic!"), xNewTD
->getName() );
197 Reference
<reflection::XInterfaceTypeDescription2
> const & xNewTD
,
198 Reference
<reflection::XInterfaceTypeDescription2
> const & xExistingTD
)
200 checkSeq( xNewTD
->getBaseTypes(), xExistingTD
->getBaseTypes(),
201 xNewTD
->getName() + OUSTR(", base types") );
202 checkSeq(xNewTD
->getOptionalBaseTypes(),xExistingTD
->getOptionalBaseTypes(),
203 xNewTD
->getName() + OUSTR(", optional base types") );
204 checkSeq( xNewTD
->getMembers(), xExistingTD
->getMembers(),
205 xNewTD
->getName() + OUSTR(", members") );
208 void checkRestParam( Reference
<reflection::XParameter
> const & xNewParam
,
209 Reference
<reflection::XParameter
> const & xExistingParam
,
210 OUString
const & context
)
212 if (xNewParam
->isRestParameter() != xExistingParam
->isRestParameter())
213 typeError( OUSTR("Different ... parameters specified!"), context
);
216 void checkRestParam( Reference
<reflection::XMethodParameter
> const &,
217 Reference
<reflection::XMethodParameter
> const &,
223 void checkParameters( Sequence
< Reference
<T
> > const & newParams
,
224 Sequence
< Reference
<T
> > const & existingParams
,
225 OUString
const & context_
)
227 sal_Int32 len
= newParams
.getLength();
228 if (len
!= existingParams
.getLength())
229 typeError( OUSTR("Different number of parameters!"), context_
);
230 Reference
<T
> const * pNewParams
= newParams
.getConstArray();
231 Reference
<T
> const * pExistingParams
= existingParams
.getConstArray();
232 for ( sal_Int32 pos
= 0; pos
< len
; ++pos
)
234 Reference
<T
> const & xNewParam
= pNewParams
[pos
];
235 Reference
<T
> const & xExistingParam
= pExistingParams
[pos
];
238 buf
.append( context_
);
239 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(", parameter ") );
241 OSL_ASSERT( pos
== xNewParam
->getPosition() &&
242 pos
== xExistingParam
->getPosition() );
243 OUString
context( buf
.makeStringAndClear() );
245 if (xNewParam
->getName() != xExistingParam
->getName())
247 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("Name differs: ") );
248 buf
.append( xNewParam
->getName() );
249 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") );
250 buf
.append( xExistingParam
->getName() );
251 typeError( buf
.makeStringAndClear(), context
);
253 check( xNewParam
->getType(), xExistingParam
->getType(), context
);
255 if (xNewParam
->isIn() != xExistingParam
->isIn())
256 typeError( OUSTR("IN attribute differs!"), context
);
257 if (xNewParam
->isOut() != xExistingParam
->isOut())
258 typeError( OUSTR("OUT attribute differs!"), context
);
259 checkRestParam( xNewParam
, xExistingParam
, context
);
263 static void checkMethod(
264 Reference
<reflection::XInterfaceMethodTypeDescription
> const & xNewTD
,
265 Reference
<reflection::XInterfaceMethodTypeDescription
> const & xExistingTD
)
267 check( xNewTD
->getReturnType(), xExistingTD
->getReturnType(),
270 if (xNewTD
->isOneway() != xExistingTD
->isOneway())
271 typeError( OUSTR("Methods have differing OneWay attribute!"),
274 checkParameters( xNewTD
->getParameters(), xExistingTD
->getParameters(),
277 checkSeq( xNewTD
->getExceptions(), xExistingTD
->getExceptions(),
278 xNewTD
->getName() + OUSTR(", declared exceptions") );
282 Reference
<reflection::XInterfaceAttributeTypeDescription2
> const & xNewTD
,
283 Reference
<reflection::XInterfaceAttributeTypeDescription2
>
284 const & xExistingTD
)
286 if (xNewTD
->isReadOnly() != xExistingTD
->isReadOnly())
287 typeError( OUSTR("ReadOnly attribute differs!"), xNewTD
->getName() );
289 check( xNewTD
->getType(), xExistingTD
->getType(),
290 xNewTD
->getName() + OUSTR(", attribute type") );
292 if (xNewTD
->isBound() != xExistingTD
->isBound())
293 typeError( OUSTR("Bound attribute differs!"), xNewTD
->getName() );
295 checkSeq( xNewTD
->getGetExceptions(), xExistingTD
->getGetExceptions(),
296 xNewTD
->getName() + OUSTR(", getter exceptions") );
297 checkSeq( xNewTD
->getSetExceptions(), xExistingTD
->getSetExceptions(),
298 xNewTD
->getName() + OUSTR(", setter exceptions") );
302 Reference
<reflection::XPropertyTypeDescription
> const & xNewTD
,
303 Reference
<reflection::XPropertyTypeDescription
> const & xExistingTD
)
305 if (xNewTD
->getPropertyFlags() != xExistingTD
->getPropertyFlags())
308 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(
309 "Different set of property flags: { ") );
310 buf
.append( getPropertyFlagsAsString(
311 xNewTD
->getPropertyFlags() ) );
312 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" } (new), { ") );
313 buf
.append( getPropertyFlagsAsString(
314 xExistingTD
->getPropertyFlags() ) );
315 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" } (existing)!") );
316 typeError( buf
.makeStringAndClear(), xNewTD
->getName() );
319 check( xNewTD
->getPropertyTypeDescription(),
320 xExistingTD
->getPropertyTypeDescription(),
325 Reference
<reflection::XSingletonTypeDescription2
> const & xNewTD
,
326 Reference
<reflection::XSingletonTypeDescription2
> const & xExistingTD
)
328 sal_Bool ifaceBased
= xNewTD
->isInterfaceBased();
329 if (ifaceBased
!= xExistingTD
->isInterfaceBased())
331 OUSTR("Mixing interface and NON-interface based singletons!"),
334 check( xNewTD
->getInterface(), xExistingTD
->getInterface(),
337 check( xNewTD
->getService().get(), xExistingTD
->getService().get(),
342 Reference
<reflection::XServiceTypeDescription2
> const & xNewTD
,
343 Reference
<reflection::XServiceTypeDescription2
> const & xExistingTD
)
345 sal_Bool singleIfaceBased
= xNewTD
->isSingleInterfaceBased();
346 if (singleIfaceBased
!= xExistingTD
->isSingleInterfaceBased())
347 typeError( OUSTR("Mixing interface and NON-interface based services!"),
349 if (singleIfaceBased
)
351 check( xNewTD
->getInterface(), xExistingTD
->getInterface(),
353 Sequence
< Reference
<reflection::XServiceConstructorDescription
> >
354 newCtors( xNewTD
->getConstructors() );
355 Sequence
< Reference
<reflection::XServiceConstructorDescription
> >
356 existingCtors( xExistingTD
->getConstructors() );
357 sal_Int32 len
= newCtors
.getLength();
358 if (len
!= existingCtors
.getLength())
359 typeError( OUSTR("Different number of service constructors!"),
361 Reference
<reflection::XServiceConstructorDescription
> const *
362 pNewCtors
= newCtors
.getConstArray();
363 Reference
<reflection::XServiceConstructorDescription
> const *
364 pExistingCtors
= existingCtors
.getConstArray();
365 for ( sal_Int32 pos
= 0; pos
< len
; ++pos
)
367 Reference
<reflection::XServiceConstructorDescription
> const &
368 xNewCtor
= pNewCtors
[pos
];
369 Reference
<reflection::XServiceConstructorDescription
> const &
370 xExistingCtor
= pExistingCtors
[pos
];
372 if (xNewCtor
->getName() != xExistingCtor
->getName())
375 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(
376 "Different constructor names: ") );
377 buf
.append( xNewCtor
->getName() );
378 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" (new), ") );
379 buf
.append( xExistingCtor
->getName() );
380 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" (existing)!") );
381 typeError( buf
.makeStringAndClear(), xNewTD
->getName() );
385 buf
.append( xNewTD
->getName() );
386 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(", constructor ") );
387 buf
.append( xNewCtor
->getName() );
388 OUString
context( buf
.makeStringAndClear() );
389 checkParameters( xNewCtor
->getParameters(),
390 xExistingCtor
->getParameters(),
392 checkSeq( xNewCtor
->getExceptions(), xExistingCtor
->getExceptions(),
393 context
+ OUSTR(", exceptions") );
396 else // old-style service descriptions:
398 checkSeq( xNewTD
->getMandatoryServices(),
399 xExistingTD
->getMandatoryServices(),
400 xNewTD
->getName() + OUSTR(", mandatory services") );
401 checkSeq( xNewTD
->getOptionalServices(),
402 xExistingTD
->getOptionalServices(),
403 xNewTD
->getName() + OUSTR(", optional services"),
404 true /* optionalMode */ );
405 checkSeq( xNewTD
->getMandatoryInterfaces(),
406 xExistingTD
->getMandatoryInterfaces(),
407 xNewTD
->getName() + OUSTR(", mandatory interfaces") );
408 checkSeq( xNewTD
->getOptionalInterfaces(),
409 xExistingTD
->getOptionalInterfaces(),
410 xNewTD
->getName() + OUSTR(", optional interfaces"),
411 true /* optionalMode */ );
413 Sequence
< Reference
<reflection::XPropertyTypeDescription
> >
414 newProperties( xNewTD
->getProperties() );
415 Sequence
< Reference
<reflection::XPropertyTypeDescription
> >
416 existingProperties( xExistingTD
->getProperties() );
417 checkSeq( newProperties
, existingProperties
,
418 xNewTD
->getName() + OUSTR(", properties"),
419 true /* optionalMode */ );
420 if (newProperties
.getLength() > existingProperties
.getLength())
422 // check whether all added properties are OPTIONAL:
423 Reference
<reflection::XPropertyTypeDescription
> const *
424 pNewProperties
= newProperties
.getConstArray();
425 for ( sal_Int32 pos
= existingProperties
.getLength() + 1;
426 pos
< newProperties
.getLength(); ++pos
)
428 if ((pNewProperties
[pos
]->getPropertyFlags() &
429 beans::PropertyAttribute::OPTIONAL
) == 0)
430 typeError( OUSTR("New property is not OPTIONAL!"),
431 pNewProperties
[pos
]->getName() );
439 namespace stoc_tdmgr
{
441 void check( Reference
<reflection::XTypeDescription
> const & xNewTD
,
442 Reference
<reflection::XTypeDescription
> const & xExistingTD
,
443 OUString
const & context
)
445 if (xNewTD
== xExistingTD
)
447 if (xNewTD
->getName() != xExistingTD
->getName())
450 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("Different type names: ") );
451 buf
.append( xNewTD
->getName() );
452 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" (new), ") );
453 buf
.append( xExistingTD
->getName() );
454 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" (existing)!") );
455 typeError( buf
.makeStringAndClear(), context
);
458 TypeClass tc
= xNewTD
->getTypeClass();
459 if (tc
!= xExistingTD
->getTypeClass())
462 buf
.append( xNewTD
->getName() );
463 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(
464 " has different type classes: ") );
465 buf
.append( getTypeClassName( tc
) );
466 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" (new), ") );
467 buf
.append( getTypeClassName( xExistingTD
->getTypeClass() ) );
468 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" (existing)!") );
469 typeError( buf
.makeStringAndClear(), context
);
475 checkEnum( Reference
<reflection::XEnumTypeDescription
>(
476 xNewTD
, UNO_QUERY_THROW
),
477 Reference
<reflection::XEnumTypeDescription
>(
478 xExistingTD
, UNO_QUERY_THROW
) );
481 case TypeClass_TYPEDEF
:
482 case TypeClass_SEQUENCE
:
483 check( Reference
<reflection::XIndirectTypeDescription
>(
484 xNewTD
, UNO_QUERY_THROW
)->getReferencedType(),
485 Reference
<reflection::XIndirectTypeDescription
>(
486 xExistingTD
, UNO_QUERY_THROW
)->getReferencedType() );
489 case TypeClass_STRUCT
:
490 case TypeClass_EXCEPTION
:
491 checkStruct( Reference
<reflection::XCompoundTypeDescription
>(
492 xNewTD
, UNO_QUERY_THROW
),
493 Reference
<reflection::XCompoundTypeDescription
>(
494 xExistingTD
, UNO_QUERY_THROW
) );
497 case TypeClass_INTERFACE
:
498 checkInterface( Reference
<reflection::XInterfaceTypeDescription2
>(
499 xNewTD
, UNO_QUERY_THROW
),
500 Reference
<reflection::XInterfaceTypeDescription2
>(
501 xExistingTD
, UNO_QUERY_THROW
) );
504 case TypeClass_SERVICE
:
505 checkService( Reference
<reflection::XServiceTypeDescription2
>(
506 xNewTD
, UNO_QUERY_THROW
),
507 Reference
<reflection::XServiceTypeDescription2
>(
508 xExistingTD
, UNO_QUERY_THROW
) );
511 case TypeClass_INTERFACE_METHOD
:
512 checkMethod( Reference
<reflection::XInterfaceMethodTypeDescription
>(
513 xNewTD
, UNO_QUERY_THROW
),
514 Reference
<reflection::XInterfaceMethodTypeDescription
>(
515 xExistingTD
, UNO_QUERY_THROW
) );
517 case TypeClass_INTERFACE_ATTRIBUTE
:
519 Reference
<reflection::XInterfaceAttributeTypeDescription2
>(
520 xNewTD
, UNO_QUERY_THROW
),
521 Reference
<reflection::XInterfaceAttributeTypeDescription2
>(
522 xExistingTD
, UNO_QUERY_THROW
) );
525 case TypeClass_PROPERTY
:
526 checkProperty( Reference
<reflection::XPropertyTypeDescription
>(
527 xNewTD
, UNO_QUERY_THROW
),
528 Reference
<reflection::XPropertyTypeDescription
>(
529 xExistingTD
, UNO_QUERY_THROW
) );
532 case TypeClass_CONSTANT
:
533 if (Reference
<reflection::XConstantTypeDescription
>(
534 xNewTD
, UNO_QUERY_THROW
)->getConstantValue() !=
535 Reference
<reflection::XConstantTypeDescription
>(
536 xExistingTD
, UNO_QUERY_THROW
)->getConstantValue())
537 typeError( OUSTR("Different constant value!"), xNewTD
->getName() );
539 case TypeClass_CONSTANTS
:
540 checkSeq( Reference
<reflection::XConstantsTypeDescription
>(
541 xNewTD
, UNO_QUERY_THROW
)->getConstants(),
542 Reference
<reflection::XConstantsTypeDescription
>(
543 xExistingTD
, UNO_QUERY_THROW
)->getConstants(),
547 case TypeClass_SINGLETON
:
548 checkSingleton( Reference
<reflection::XSingletonTypeDescription2
>(
549 xNewTD
, UNO_QUERY_THROW
),
550 Reference
<reflection::XSingletonTypeDescription2
>(
551 xExistingTD
, UNO_QUERY_THROW
) );