Remove UNOIDL "array" and "union" vaporware remnants

...and deprecate what cannot be removed for compatibility.

Change-Id: I1ea335af775b867b468b8285113631167729a92a
This commit is contained in:
Stephan Bergmann
2014-01-31 10:15:47 +01:00
parent 11235e8649
commit 9e77c2fb7c
27 changed files with 54 additions and 230 deletions

View File

@@ -171,9 +171,7 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c
case typelib_TypeClass_TYPE: case typelib_TypeClass_TYPE:
case typelib_TypeClass_ANY: case typelib_TypeClass_ANY:
case typelib_TypeClass_TYPEDEF: case typelib_TypeClass_TYPEDEF:
case typelib_TypeClass_UNION:
case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_SEQUENCE:
case typelib_TypeClass_ARRAY:
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
return 0; return 0;
case typelib_TypeClass_STRUCT: case typelib_TypeClass_STRUCT:

View File

@@ -171,9 +171,7 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c
case typelib_TypeClass_TYPE: case typelib_TypeClass_TYPE:
case typelib_TypeClass_ANY: case typelib_TypeClass_ANY:
case typelib_TypeClass_TYPEDEF: case typelib_TypeClass_TYPEDEF:
case typelib_TypeClass_UNION:
case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_SEQUENCE:
case typelib_TypeClass_ARRAY:
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
return 0; return 0;
case typelib_TypeClass_STRUCT: case typelib_TypeClass_STRUCT:

View File

@@ -171,9 +171,7 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c
case typelib_TypeClass_TYPE: case typelib_TypeClass_TYPE:
case typelib_TypeClass_ANY: case typelib_TypeClass_ANY:
case typelib_TypeClass_TYPEDEF: case typelib_TypeClass_TYPEDEF:
case typelib_TypeClass_UNION:
case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_SEQUENCE:
case typelib_TypeClass_ARRAY:
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
return 0; return 0;
case typelib_TypeClass_STRUCT: case typelib_TypeClass_STRUCT:

View File

@@ -94,7 +94,6 @@ bool isBootstrapType(OUString const & name) {
"com.sun.star.reflection.ParamInfo", "com.sun.star.reflection.ParamInfo",
"com.sun.star.reflection.ParamMode", "com.sun.star.reflection.ParamMode",
"com.sun.star.reflection.TypeDescriptionSearchDepth", "com.sun.star.reflection.TypeDescriptionSearchDepth",
"com.sun.star.reflection.XArrayTypeDescription",
"com.sun.star.reflection.XCompoundTypeDescription", "com.sun.star.reflection.XCompoundTypeDescription",
"com.sun.star.reflection.XEnumTypeDescription", "com.sun.star.reflection.XEnumTypeDescription",
"com.sun.star.reflection.XIdlArray", "com.sun.star.reflection.XIdlArray",
@@ -115,7 +114,6 @@ bool isBootstrapType(OUString const & name) {
"com.sun.star.reflection.XTypeDescription", "com.sun.star.reflection.XTypeDescription",
"com.sun.star.reflection.XTypeDescriptionEnumeration", "com.sun.star.reflection.XTypeDescriptionEnumeration",
"com.sun.star.reflection.XTypeDescriptionEnumerationAccess", "com.sun.star.reflection.XTypeDescriptionEnumerationAccess",
"com.sun.star.reflection.XUnionTypeDescription",
"com.sun.star.registry.RegistryKeyType", "com.sun.star.registry.RegistryKeyType",
"com.sun.star.registry.RegistryValueType", "com.sun.star.registry.RegistryValueType",
"com.sun.star.registry.XImplementationRegistration", "com.sun.star.registry.XImplementationRegistration",

View File

@@ -70,7 +70,6 @@ namespace comphelper
using ::com::sun::star::uno::TypeClass_ANY; using ::com::sun::star::uno::TypeClass_ANY;
using ::com::sun::star::uno::TypeClass_EXCEPTION; using ::com::sun::star::uno::TypeClass_EXCEPTION;
using ::com::sun::star::uno::TypeClass_STRUCT; using ::com::sun::star::uno::TypeClass_STRUCT;
using ::com::sun::star::uno::TypeClass_UNION;
using ::com::sun::star::uno::TypeClass_FLOAT; using ::com::sun::star::uno::TypeClass_FLOAT;
using ::com::sun::star::uno::TypeClass_DOUBLE; using ::com::sun::star::uno::TypeClass_DOUBLE;
using ::com::sun::star::uno::TypeClass_INTERFACE; using ::com::sun::star::uno::TypeClass_INTERFACE;
@@ -462,7 +461,6 @@ namespace comphelper
break; break;
case TypeClass_EXCEPTION: case TypeClass_EXCEPTION:
case TypeClass_STRUCT: case TypeClass_STRUCT:
case TypeClass_UNION:
{ {
// values are accepted if and only if their type equals, or is derived from, our value type // values are accepted if and only if their type equals, or is derived from, our value type

View File

@@ -297,8 +297,6 @@ void appendValue( OUStringBuffer & buf,
case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_UNSIGNED_HYPER:
buf.append( *static_cast< sal_Int64 const * >(val) ); buf.append( *static_cast< sal_Int64 const * >(val) );
break; break;
// case typelib_TypeClass_UNION:
// case typelib_TypeClass_ARRAY:
// case typelib_TypeClass_UNKNOWN: // case typelib_TypeClass_UNKNOWN:
// case typelib_TypeClass_SERVICE: // case typelib_TypeClass_SERVICE:
// case typelib_TypeClass_MODULE: // case typelib_TypeClass_MODULE:

View File

@@ -51,7 +51,6 @@ static bool relatesToInterface(typelib_TypeDescription * pTypeDescr)
switch (((typelib_IndirectTypeDescription *)pTypeDescr)->pType->eTypeClass) switch (((typelib_IndirectTypeDescription *)pTypeDescr)->pType->eTypeClass)
{ {
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
case typelib_TypeClass_UNION: // might relate to interface
case typelib_TypeClass_ANY: // might relate to interface case typelib_TypeClass_ANY: // might relate to interface
return true; return true;
case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_SEQUENCE:
@@ -80,7 +79,6 @@ static bool relatesToInterface(typelib_TypeDescription * pTypeDescr)
switch (pTypes[nPos]->eTypeClass) switch (pTypes[nPos]->eTypeClass)
{ {
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
case typelib_TypeClass_UNION: // might relate to interface
case typelib_TypeClass_ANY: // might relate to interface case typelib_TypeClass_ANY: // might relate to interface
return true; return true;
// case typelib_TypeClass_TYPEDEF: // case typelib_TypeClass_TYPEDEF:
@@ -103,7 +101,6 @@ static bool relatesToInterface(typelib_TypeDescription * pTypeDescr)
return relatesToInterface( (typelib_TypeDescription *)pComp->pBaseTypeDescription ); return relatesToInterface( (typelib_TypeDescription *)pComp->pBaseTypeDescription );
break; break;
} }
case typelib_TypeClass_UNION: // might relate to interface
case typelib_TypeClass_ANY: // might relate to interface case typelib_TypeClass_ANY: // might relate to interface
case typelib_TypeClass_INTERFACE: case typelib_TypeClass_INTERFACE:
return true; return true;

View File

@@ -47,7 +47,6 @@
#include <com/sun/star/reflection/XInterfaceTypeDescription2.hpp> #include <com/sun/star/reflection/XInterfaceTypeDescription2.hpp>
#include <com/sun/star/reflection/XCompoundTypeDescription.hpp> #include <com/sun/star/reflection/XCompoundTypeDescription.hpp>
#include <com/sun/star/reflection/XStructTypeDescription.hpp> #include <com/sun/star/reflection/XStructTypeDescription.hpp>
#include <com/sun/star/reflection/XUnionTypeDescription.hpp>
#include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/RuntimeException.hpp"
#include "boost/scoped_array.hpp" #include "boost/scoped_array.hpp"
@@ -65,104 +64,6 @@ static typelib_TypeDescription * createCTD(
Reference< container::XHierarchicalNameAccess > const & access, Reference< container::XHierarchicalNameAccess > const & access,
const Reference< XTypeDescription > & xType ); const Reference< XTypeDescription > & xType );
//==================================================================================================
inline static sal_Int64 coerceToInt64( const Any & rVal )
{
switch (rVal.getValueTypeClass())
{
case TypeClass_CHAR:
return *(sal_Unicode *)rVal.getValue();
case TypeClass_BOOLEAN:
return (*(sal_Bool *)rVal.getValue() ? 1 : 0);
case TypeClass_BYTE:
return *(sal_Int8 *)rVal.getValue();
case TypeClass_SHORT:
return *(sal_Int16 *)rVal.getValue();
case TypeClass_UNSIGNED_SHORT:
return *(sal_uInt16 *)rVal.getValue();
case TypeClass_LONG:
return *(sal_Int32 *)rVal.getValue();
case TypeClass_UNSIGNED_LONG:
return *(sal_uInt32 *)rVal.getValue();
case TypeClass_HYPER:
return *(sal_Int64 *)rVal.getValue();
case TypeClass_UNSIGNED_HYPER:
return *(sal_uInt64 *)rVal.getValue();
case TypeClass_ENUM:
return *(int *)rVal.getValue();
default:
OSL_ASSERT(false);
return 0;
}
}
//==================================================================================================
inline static typelib_TypeDescription * createCTD(
const Reference< XUnionTypeDescription > & xType )
{
typelib_TypeDescription * pRet = 0;
if (xType.is())
{
OUString aTypeName( xType->getName() );
// discriminant type
Reference< XTypeDescription > xDiscrTD( xType->getDiscriminantType() );
OUString aDiscrTypeName( xDiscrTD->getName() );
typelib_TypeDescriptionReference * pDiscrTypeRef = 0;
typelib_typedescriptionreference_new( &pDiscrTypeRef,
(typelib_TypeClass)xDiscrTD->getTypeClass(),
aDiscrTypeName.pData );
// default member type
Reference< XTypeDescription > xDefaultMemberTD( xType->getDefaultMemberType() );
OUString aDefMemberTypeName( xDefaultMemberTD->getName() );
typelib_TypeDescriptionReference * pDefMemberTypeRef = 0;
typelib_typedescriptionreference_new( &pDefMemberTypeRef,
(typelib_TypeClass)xDefaultMemberTD->getTypeClass(),
aDefMemberTypeName.pData );
// init array
Sequence< Any > aDiscriminants( xType->getDiscriminants() );
Sequence< Reference< XTypeDescription > > aMemberTypes( xType->getMemberTypes() );
Sequence< OUString > aMemberNames( xType->getMemberNames() );
sal_Int32 nMembers = aDiscriminants.getLength();
OSL_ASSERT( nMembers == aMemberNames.getLength() && nMembers == aMemberTypes.getLength() );
const Any * pDiscriminants = aDiscriminants.getConstArray();
const Reference< XTypeDescription > * pMemberTypes = aMemberTypes.getConstArray();
const OUString * pMemberNames = aMemberNames.getConstArray();
typelib_Union_Init * pMembers = (typelib_Union_Init *)alloca( nMembers * sizeof(typelib_Union_Init) );
sal_Int32 nPos;
for ( nPos = nMembers; nPos--; )
{
typelib_Union_Init & rEntry = pMembers[nPos];
// member discriminant
rEntry.nDiscriminant = coerceToInt64( pDiscriminants[nPos] );
// member type
OUString aMemberTypeName( pMemberTypes[nPos]->getName() );
rEntry.pTypeRef = 0;
typelib_typedescriptionreference_new( &rEntry.pTypeRef,
(typelib_TypeClass)pMemberTypes[nPos]->getTypeClass(),
aMemberTypeName.pData );
// member name
rEntry.pMemberName = pMemberNames[nPos].pData;
}
typelib_typedescription_newUnion( &pRet, aTypeName.pData,
pDiscrTypeRef,
coerceToInt64( xType->getDefaultDiscriminant() ),
pDefMemberTypeRef,
nMembers, pMembers );
for ( nPos = nMembers; nPos--; )
{
typelib_typedescriptionreference_release( pMembers[nPos].pTypeRef );
}
typelib_typedescriptionreference_release( pDiscrTypeRef );
typelib_typedescriptionreference_release( pDefMemberTypeRef );
}
return pRet;
}
//================================================================================================== //==================================================================================================
inline static typelib_TypeDescription * createCTD( inline static typelib_TypeDescription * createCTD(
const Reference< XCompoundTypeDescription > & xType ) const Reference< XCompoundTypeDescription > & xType )
@@ -620,9 +521,6 @@ static typelib_TypeDescription * createCTD(
break; break;
} }
case TypeClass_UNION:
pRet = createCTD( Reference< XUnionTypeDescription >::query( xType ) );
break;
case TypeClass_EXCEPTION: case TypeClass_EXCEPTION:
pRet = createCTD( Reference< XCompoundTypeDescription >::query( xType ) ); pRet = createCTD( Reference< XCompoundTypeDescription >::query( xType ) );
break; break;

View File

@@ -963,12 +963,7 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny)
//TypeClass_TYPEDEF //TypeClass_TYPEDEF
//TypeClass_ANY: //TypeClass_ANY:
//TypeClass_UNKNOWN: //TypeClass_UNKNOWN:
//TypeClass_UNSIGNED_OCTET: //TypeClass_MODULE:
// TypeClass_UNION:
// TypeClass_ARRAY:
// TypeClass_UNSIGNED_INT:
// TypeClass_UNSIGNED_BYTE:
// TypeClass_MODULE:
throw CannotConvertException( throw CannotConvertException(
"[automation bridge]UnoConversionUtilities<T>::anyToVariant\n" "[automation bridge]UnoConversionUtilities<T>::anyToVariant\n"
"There is no conversion for this UNO type to a Automation type." "There is no conversion for this UNO type to a Automation type."

View File

@@ -2207,7 +2207,6 @@ namespace pcr
return false; return false;
if ( ( _rProperty.Type.getTypeClass() == TypeClass_INTERFACE ) if ( ( _rProperty.Type.getTypeClass() == TypeClass_INTERFACE )
|| ( _rProperty.Type.getTypeClass() == TypeClass_ARRAY )
|| ( _rProperty.Type.getTypeClass() == TypeClass_UNKNOWN ) || ( _rProperty.Type.getTypeClass() == TypeClass_UNKNOWN )
) )
return true; return true;

View File

@@ -278,8 +278,7 @@ SAL_CALL getCppuType( const ::com::sun::star::uno::Sequence< E > * )
/** Gets the meta type of IDL sequence. /** Gets the meta type of IDL sequence.
This function has been introduced, because one cannot get the (templated) This function has been introduced, because one cannot get the (templated)
cppu type out of C++ array types. Array types have special cppu type out of C++ array types.
getCppuArrayTypeN() functions.
@attention @attention
the given element type must be the same as the template argument type! the given element type must be the same as the template argument type!

View File

@@ -61,13 +61,19 @@ typedef enum _typelib_TypeClass
typelib_TypeClass_TYPEDEF = 16, typelib_TypeClass_TYPEDEF = 16,
/** type class of struct */ /** type class of struct */
typelib_TypeClass_STRUCT = 17, typelib_TypeClass_STRUCT = 17,
/** type class of union (not implemented) */ /** Deprecated, UNOIDL does not have a union concept.
@deprecated
*/
typelib_TypeClass_UNION = 18, typelib_TypeClass_UNION = 18,
/** type class of exception */ /** type class of exception */
typelib_TypeClass_EXCEPTION = 19, typelib_TypeClass_EXCEPTION = 19,
/** type class of sequence */ /** type class of sequence */
typelib_TypeClass_SEQUENCE = 20, typelib_TypeClass_SEQUENCE = 20,
/** type class of array (not implemented) */ /** Deprecated, UNOIDL does not have an array concept.
@deprecated
*/
typelib_TypeClass_ARRAY = 21, typelib_TypeClass_ARRAY = 21,
/** type class of interface */ /** type class of interface */
typelib_TypeClass_INTERFACE = 22, typelib_TypeClass_INTERFACE = 22,

View File

@@ -3389,13 +3389,11 @@ com.sun.star.reflection.XInterfaceMemberTypeDescription
com.sun.star.reflection.XInterfaceTypeDescription com.sun.star.reflection.XInterfaceTypeDescription
com.sun.star.reflection.XInterfaceMethodTypeDescription com.sun.star.reflection.XInterfaceMethodTypeDescription
com.sun.star.reflection.XIndirectTypeDescription com.sun.star.reflection.XIndirectTypeDescription
com.sun.star.reflection.XUnionTypeDescription
com.sun.star.reflection.TypeDescriptionProvider com.sun.star.reflection.TypeDescriptionProvider
com.sun.star.reflection.XInterfaceAttributeTypeDescription com.sun.star.reflection.XInterfaceAttributeTypeDescription
com.sun.star.reflection.XTypeDescription com.sun.star.reflection.XTypeDescription
com.sun.star.reflection.XCompoundTypeDescription com.sun.star.reflection.XCompoundTypeDescription
com.sun.star.container.XHierarchicalNameAccess com.sun.star.container.XHierarchicalNameAccess
com.sun.star.reflection.XArrayTypeDescription
TOPIC: TOPIC:
LINK:Documentation/DevGuide/OfficeDev/Component/Controllers#XSelectionSupplier LINK:Documentation/DevGuide/OfficeDev/Component/Controllers#XSelectionSupplier

View File

@@ -118,10 +118,6 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
break; break;
} }
case typelib_TypeClass_UNION:
{
break;
}
case typelib_TypeClass_STRUCT: case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION: case typelib_TypeClass_EXCEPTION:
{ {
@@ -283,7 +279,6 @@ OUString val2str( const void * pVal, typelib_TypeDescriptionReference * pTypeRef
break; break;
case typelib_TypeClass_VOID: case typelib_TypeClass_VOID:
case typelib_TypeClass_ARRAY:
case typelib_TypeClass_UNKNOWN: case typelib_TypeClass_UNKNOWN:
case typelib_TypeClass_SERVICE: case typelib_TypeClass_SERVICE:
case typelib_TypeClass_MODULE: case typelib_TypeClass_MODULE:

View File

@@ -81,10 +81,6 @@ const char *typeClassToString( TypeClass t )
ret = "INTERFACE"; break; ret = "INTERFACE"; break;
case com::sun::star::uno::TypeClass_TYPEDEF: case com::sun::star::uno::TypeClass_TYPEDEF:
ret = "TYPEDEF"; break; ret = "TYPEDEF"; break;
case com::sun::star::uno::TypeClass_UNION:
ret = "UNION"; break;
case com::sun::star::uno::TypeClass_ARRAY:
ret = "ARRAY"; break;
case com::sun::star::uno::TypeClass_SERVICE: case com::sun::star::uno::TypeClass_SERVICE:
ret = "SERVICE"; break; ret = "SERVICE"; break;
case com::sun::star::uno::TypeClass_MODULE: case com::sun::star::uno::TypeClass_MODULE:

View File

@@ -19,11 +19,9 @@
package com.sun.star.uno; package com.sun.star.uno;
/** /**
* The Union class is the base class for all classes generated * Deprecated, UNOIDL does not have a union concept.
* as java binding for the IDL type union. *
* <p> * @deprecated
* Note: The idl type <code>union<code> is currently not fully
* integrated into the UNO framework, so don't use it.
*/ */
public class Union { public class Union {
/** /**

View File

@@ -63,14 +63,12 @@ class TypeClass(object):
TYPEDEF = 16 TYPEDEF = 16
# type class of struct # type class of struct
STRUCT = 17 STRUCT = 17
# type class of union (not implemented)
UNION = 18
# type class of exception # type class of exception
EXCEPTION = 19 EXCEPTION = 19
# type class of sequence # type class of sequence
SEQUENCE = 20 SEQUENCE = 20
# type class of array (not implemented)
ARRAY = 21
# type class of interface # type class of interface
INTERFACE = 22 INTERFACE = 22
# type class of service (not implemented) # type class of service (not implemented)
@@ -236,14 +234,10 @@ def make_uno_type(val):
pass pass
elif type_class == TypeClass.STRUCT: elif type_class == TypeClass.STRUCT:
uno_type = StructType(val, full_val) uno_type = StructType(val, full_val)
elif type_class == TypeClass.UNION:
raise UnsupportedType('union')
elif type_class == TypeClass.EXCEPTION: elif type_class == TypeClass.EXCEPTION:
uno_type = CompoundType(val, full_val) uno_type = CompoundType(val, full_val)
elif type_class == TypeClass.SEQUENCE: elif type_class == TypeClass.SEQUENCE:
uno_type = IndirectType(val, full_val) uno_type = IndirectType(val, full_val)
elif type_class == TypeClass.ARRAY:
raise UnsupportedType('array')
elif type_class == TypeClass.INTERFACE: elif type_class == TypeClass.INTERFACE:
uno_type = InterfaceType(val, full_val) uno_type = InterfaceType(val, full_val)
elif type_class == TypeClass.SERVICE: elif type_class == TypeClass.SERVICE:

View File

@@ -87,7 +87,7 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 nLen )
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{ {
TypeClass eTC = rArray.getValueTypeClass(); TypeClass eTC = rArray.getValueTypeClass();
if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) if (eTC != TypeClass_SEQUENCE)
{ {
throw IllegalArgumentException( throw IllegalArgumentException(
OUString("no sequence given!"), OUString("no sequence given!"),
@@ -112,7 +112,7 @@ sal_Int32 ArrayIdlClassImpl::getLen( const Any & rArray )
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{ {
TypeClass eTC = rArray.getValueTypeClass(); TypeClass eTC = rArray.getValueTypeClass();
if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) if (eTC != TypeClass_SEQUENCE)
{ {
throw IllegalArgumentException( throw IllegalArgumentException(
OUString("no sequence given!"), OUString("no sequence given!"),
@@ -126,7 +126,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 nIndex )
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::ArrayIndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::ArrayIndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
{ {
TypeClass eTC = rArray.getValueTypeClass(); TypeClass eTC = rArray.getValueTypeClass();
if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) if (eTC != TypeClass_SEQUENCE)
{ {
throw IllegalArgumentException( throw IllegalArgumentException(
OUString("no sequence given!"), OUString("no sequence given!"),
@@ -157,7 +157,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::ArrayIndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::ArrayIndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
{ {
TypeClass eTC = rArray.getValueTypeClass(); TypeClass eTC = rArray.getValueTypeClass();
if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) if (eTC != TypeClass_SEQUENCE)
{ {
throw IllegalArgumentException( throw IllegalArgumentException(
OUString("no sequence given!"), OUString("no sequence given!"),

View File

@@ -208,11 +208,9 @@ inline Reference< XIdlClass > IdlReflectionServiceImpl::constructClass(
return new EnumIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr ); return new EnumIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr );
case typelib_TypeClass_STRUCT: case typelib_TypeClass_STRUCT:
case typelib_TypeClass_UNION:
case typelib_TypeClass_EXCEPTION: case typelib_TypeClass_EXCEPTION:
return new CompoundIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr ); return new CompoundIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr );
case typelib_TypeClass_ARRAY:
case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_SEQUENCE:
return new ArrayIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr ); return new ArrayIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr );

View File

@@ -521,9 +521,8 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy
case TypeClass_ANY: case TypeClass_ANY:
return rVal; return rVal;
// --- to STRUCT, UNION, EXCEPTION ---------------------------------------------------------- // --- to STRUCT, EXCEPTION ----------------------------------------------------------
case TypeClass_STRUCT: case TypeClass_STRUCT:
// case TypeClass_UNION: // xxx todo
case TypeClass_EXCEPTION: case TypeClass_EXCEPTION:
{ {
// same types or destination type is derived source type? // same types or destination type is derived source type?
@@ -700,22 +699,26 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
switch (aDestinationClass) switch (aDestinationClass)
{ {
// only simple Conversion of _simple_ types // only simple Conversion of _simple_ types
case TypeClass_INTERFACE: case TypeClass_VOID:
case TypeClass_SERVICE: case TypeClass_BOOLEAN:
case TypeClass_STRUCT: case TypeClass_BYTE:
case TypeClass_TYPEDEF: case TypeClass_SHORT:
case TypeClass_UNION: case TypeClass_UNSIGNED_SHORT:
case TypeClass_EXCEPTION: case TypeClass_LONG:
case TypeClass_ARRAY: case TypeClass_UNSIGNED_LONG:
case TypeClass_SEQUENCE: case TypeClass_HYPER:
case TypeClass_ENUM: case TypeClass_UNSIGNED_HYPER:
case TypeClass_UNKNOWN: case TypeClass_FLOAT:
case TypeClass_MODULE: case TypeClass_DOUBLE:
case TypeClass_CHAR:
case TypeClass_STRING:
case TypeClass_ANY:
break;
default:
throw IllegalArgumentException( throw IllegalArgumentException(
OUString("destination type is not simple!"), OUString("destination type is not simple!"),
Reference< XInterface >(), (sal_Int16) 1 ); Reference< XInterface >(), (sal_Int16) 1 );
default:
break;
} }
Type aSourceType = rVal.getValueType(); Type aSourceType = rVal.getValueType();

View File

@@ -585,7 +585,7 @@ static sal_Int32 initBlocks( ConvBlock * pTestBlocks )
pTestBlocks[nElems++] = ConvBlock( aVal, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ); pTestBlocks[nElems++] = ConvBlock( aVal, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa // st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
// ==SEQ of ANY== // ==SEQ of ANY==
Sequence< Any > aAnySeq( 2 ), aAnySeq2( 2 ), aAnySeq3( 2 ); Sequence< Any > aAnySeq( 2 ), aAnySeq2( 2 );
Any * pAnySeq = aAnySeq.getArray(); Any * pAnySeq = aAnySeq.getArray();
pAnySeq[0] = makeAny( aINT32Seq ); pAnySeq[0] = makeAny( aINT32Seq );
pAnySeq[1] = makeAny( OUString("lala") ); pAnySeq[1] = makeAny( OUString("lala") );
@@ -598,12 +598,6 @@ static sal_Int32 initBlocks( ConvBlock * pTestBlocks )
aVal <<= aAnySeq2; aVal <<= aAnySeq2;
pTestBlocks[nElems++] = ConvBlock( aVal, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 ); pTestBlocks[nElems++] = ConvBlock( aVal, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa // st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
pAnySeq = aAnySeq3.getArray();
pAnySeq[0] <<= OUString("TypeClass_UNION");
pAnySeq[1] <<= OUString("TypeClass_ENUM");
aVal <<= aAnySeq3;
pTestBlocks[nElems++] = ConvBlock( aVal, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 );
// st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa
return nElems; return nElems;
} }

View File

@@ -103,10 +103,8 @@ OUString AnyToString( const Any& aValue, sal_Bool bIncludeType, const Reference<
case TypeClass_SERVICE: aRetStr = "TYPE SERVICE"; break; case TypeClass_SERVICE: aRetStr = "TYPE SERVICE"; break;
case TypeClass_STRUCT: aRetStr = "TYPE STRUCT"; break; case TypeClass_STRUCT: aRetStr = "TYPE STRUCT"; break;
case TypeClass_TYPEDEF: aRetStr = "TYPE TYPEDEF"; break; case TypeClass_TYPEDEF: aRetStr = "TYPE TYPEDEF"; break;
case TypeClass_UNION: aRetStr = "TYPE UNION"; break;
case TypeClass_ENUM: aRetStr = "TYPE ENUM"; break; case TypeClass_ENUM: aRetStr = "TYPE ENUM"; break;
case TypeClass_EXCEPTION: aRetStr = "TYPE EXCEPTION"; break; case TypeClass_EXCEPTION: aRetStr = "TYPE EXCEPTION"; break;
case TypeClass_ARRAY: aRetStr = "TYPE ARRAY"; break;
case TypeClass_SEQUENCE: aRetStr = "TYPE SEQUENCE"; break; case TypeClass_SEQUENCE: aRetStr = "TYPE SEQUENCE"; break;
case TypeClass_VOID: aRetStr = "TYPE void"; break; case TypeClass_VOID: aRetStr = "TYPE void"; break;
case TypeClass_ANY: aRetStr = "TYPE any"; break; case TypeClass_ANY: aRetStr = "TYPE any"; break;

View File

@@ -26,9 +26,7 @@
module com { module sun { module star { module reflection { module com { module sun { module star { module reflection {
/** Deprecated. Arrays are not supported. /** Deprecated, UNOIDL does not have an array concept.
Reflects a fixed-size array type.
The type class of this description is TypeClass_ARRAY.
@deprecated @deprecated
*/ */

View File

@@ -26,10 +26,7 @@
module com { module sun { module star { module reflection { module com { module sun { module star { module reflection {
/** Deprecated. Unions are not supported. /** Deprecated, UNOIDL does not have a union concept.
Reflects a union type.
The discriminant of a union switches between the current value types.
In addition, there is also a default case, having no discriminant.
@deprecated @deprecated
*/ */

View File

@@ -89,7 +89,9 @@ published enum TypeClass
/** reflecting compound types /** reflecting compound types
*/ */
STRUCT, STRUCT,
/** reflecting union types /** Deprecated, UNOIDL does not have a union concept.
@deprecated
*/ */
UNION, UNION,
/** reflecting exception types /** reflecting exception types
@@ -98,7 +100,9 @@ published enum TypeClass
/** reflecting sequence types /** reflecting sequence types
*/ */
SEQUENCE, SEQUENCE,
/** reflecting array types /** Deprecated, UNOIDL does not have an array concept.
@deprecated
*/ */
ARRAY, ARRAY,
/** reflecting interface types /** reflecting interface types

View File

@@ -2893,9 +2893,7 @@ void CMAccessible::get_OLECHARFromAny(Any& pAny, OLECHAR* pChar)
case TypeClass_TYPE: case TypeClass_TYPE:
case TypeClass_ANY: case TypeClass_ANY:
case TypeClass_TYPEDEF: case TypeClass_TYPEDEF:
case TypeClass_UNION:
case TypeClass_EXCEPTION: case TypeClass_EXCEPTION:
case TypeClass_ARRAY:
case TypeClass_INTERFACE: case TypeClass_INTERFACE:
case TypeClass_SERVICE: case TypeClass_SERVICE:
case TypeClass_MODULE: case TypeClass_MODULE:
@@ -3047,10 +3045,8 @@ void CMAccessible::ConvertAnyToVariant(const ::com::sun::star::uno::Any &rAnyVal
case TypeClass_ENUM: case TypeClass_ENUM:
case TypeClass_TYPEDEF: case TypeClass_TYPEDEF:
case TypeClass_STRUCT: case TypeClass_STRUCT:
case TypeClass_UNION:
case TypeClass_EXCEPTION: case TypeClass_EXCEPTION:
case TypeClass_SEQUENCE: case TypeClass_SEQUENCE:
case TypeClass_ARRAY:
case TypeClass_INTERFACE: case TypeClass_INTERFACE:
{ {
Reference< XAccessible > pXAcc; Reference< XAccessible > pXAcc;

View File

@@ -43,8 +43,7 @@ public class NumericalHelper
public static final int CHAR_TYPE = 6; public static final int CHAR_TYPE = 6;
public static final int STRING_TYPE = -1; public static final int STRING_TYPE = -1;
public static final int BOOLEAN_TYPE = -2; public static final int BOOLEAN_TYPE = -2;
public static final int ARRAY_TYPE = -3; public static final int SEQUENCE_TYPE = -3;
public static final int SEQUENCE_TYPE = -4;
public static final int ASCII_VALUE_0 = 48; public static final int ASCII_VALUE_0 = 48;
public static final int ASCII_VALUE_A = 65; public static final int ASCII_VALUE_A = 65;
public static final int COUNT_CHARS_IN_ALPHABET = 26; public static final int COUNT_CHARS_IN_ALPHABET = 26;
@@ -659,7 +658,7 @@ public class NumericalHelper
case BOOLEAN_TYPE: case BOOLEAN_TYPE:
retValue = aTypeObject.aValue.toString(); retValue = aTypeObject.aValue.toString();
break; break;
case ARRAY_TYPE: case SEQUENCE_TYPE:
retValue = new String(toByteArray((aValue))); retValue = new String(toByteArray((aValue)));
break; break;
default: default:
@@ -738,11 +737,7 @@ public class NumericalHelper
TypeObject aTypeObject = getTypeObject(anArrayValue); TypeObject aTypeObject = getTypeObject(anArrayValue);
if (aTypeObject.iType == SEQUENCE_TYPE) if (aTypeObject.iType == SEQUENCE_TYPE)
{ {
aTypeObject = convertSequenceToObjectArray(aTypeObject); Object[] obj = convertSequenceToObjectArray(aTypeObject);
}
if (aTypeObject.iType == ARRAY_TYPE)
{
Object[] obj = (Object[]) aTypeObject.aValue;
retValue = new int[obj.length]; retValue = new int[obj.length];
for (int i = 0; i < obj.length; i++) for (int i = 0; i < obj.length; i++)
{ {
@@ -772,11 +767,7 @@ public class NumericalHelper
TypeObject aTypeObject = getTypeObject(anArrayValue); TypeObject aTypeObject = getTypeObject(anArrayValue);
if (aTypeObject.iType == SEQUENCE_TYPE) if (aTypeObject.iType == SEQUENCE_TYPE)
{ {
aTypeObject = convertSequenceToObjectArray(aTypeObject); Object[] obj = convertSequenceToObjectArray(aTypeObject);
}
if (aTypeObject.iType == ARRAY_TYPE)
{
Object[] obj = (Object[]) aTypeObject.aValue;
retValue = new byte[obj.length]; retValue = new byte[obj.length];
for (int i = 0; i < obj.length; i++) for (int i = 0; i < obj.length; i++)
{ {
@@ -806,11 +797,7 @@ public class NumericalHelper
TypeObject aTypeObject = getTypeObject(anArrayValue); TypeObject aTypeObject = getTypeObject(anArrayValue);
if (aTypeObject.iType == SEQUENCE_TYPE) if (aTypeObject.iType == SEQUENCE_TYPE)
{ {
aTypeObject = convertSequenceToObjectArray(aTypeObject); Object[] obj = convertSequenceToObjectArray(aTypeObject);
}
if (aTypeObject.iType == ARRAY_TYPE)
{
Object[] obj = (Object[]) aTypeObject.aValue;
retValue = new short[obj.length]; retValue = new short[obj.length];
for (int i = 0; i < obj.length; i++) for (int i = 0; i < obj.length; i++)
{ {
@@ -840,11 +827,7 @@ public class NumericalHelper
TypeObject aTypeObject = getTypeObject(anArrayValue); TypeObject aTypeObject = getTypeObject(anArrayValue);
if (aTypeObject.iType == SEQUENCE_TYPE) if (aTypeObject.iType == SEQUENCE_TYPE)
{ {
aTypeObject = convertSequenceToObjectArray(aTypeObject); Object[] obj = convertSequenceToObjectArray(aTypeObject);
}
if (aTypeObject.iType == ARRAY_TYPE)
{
Object[] obj = (Object[]) aTypeObject.aValue;
retValue = new String[obj.length]; retValue = new String[obj.length];
for (int i = 0; i < obj.length; i++) for (int i = 0; i < obj.length; i++)
{ {
@@ -1120,13 +1103,6 @@ public class NumericalHelper
aTypeObject.iType = BOOLEAN_TYPE; aTypeObject.iType = BOOLEAN_TYPE;
aTypeObject.aValue = Boolean.valueOf(AnyConverter.toBoolean(aValue)); aTypeObject.aValue = Boolean.valueOf(AnyConverter.toBoolean(aValue));
break; break;
case TypeClass.ARRAY_value:
aTypeObject.iType = ARRAY_TYPE;
aTypeObject.aValue = new Object[]
{
AnyConverter.toArray(aValue)
};
break;
case TypeClass.SEQUENCE_value: case TypeClass.SEQUENCE_value:
aTypeObject.iType = SEQUENCE_TYPE; aTypeObject.iType = SEQUENCE_TYPE;
aTypeObject.aValue = aValue; aTypeObject.aValue = aValue;
@@ -1302,13 +1278,11 @@ public class NumericalHelper
} }
} }
private static TypeObject convertSequenceToObjectArray( private static Object[] convertSequenceToObjectArray(
TypeObject sourceObject) TypeObject sourceObject)
throws com.sun.star.lang.IllegalArgumentException throws com.sun.star.lang.IllegalArgumentException
{ {
TypeObject destObject = new TypeObject();
Object array = sourceObject.aValue; Object array = sourceObject.aValue;
destObject.iType = ARRAY_TYPE;
Class<?> c = array.getClass(); Class<?> c = array.getClass();
Object[] aShortVal = null; Object[] aShortVal = null;
if (c.equals(byte[].class)) if (c.equals(byte[].class))
@@ -1388,8 +1362,7 @@ public class NumericalHelper
"Cannot convert unknown type: '" + e.getMessage() + "'"); "Cannot convert unknown type: '" + e.getMessage() + "'");
} }
} }
destObject.aValue = aShortVal; return aShortVal;
return destObject;
} }
/** /**