diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-31 10:15:47 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-31 10:15:47 +0100 |
commit | 9e77c2fb7cadfd477fb1b971b011d43f30781660 (patch) | |
tree | 7a7d70822e2628a1e6383a15eeedb8fea5309123 /stoc | |
parent | 11235e86497df47ff3acc61c1cab9fff0b91949e (diff) |
Remove UNOIDL "array" and "union" vaporware remnants
...and deprecate what cannot be removed for compatibility.
Change-Id: I1ea335af775b867b468b8285113631167729a92a
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/corereflection/crarray.cxx | 8 | ||||
-rw-r--r-- | stoc/source/corereflection/crefl.cxx | 2 | ||||
-rw-r--r-- | stoc/source/typeconv/convert.cxx | 33 | ||||
-rw-r--r-- | stoc/test/testconv.cxx | 8 | ||||
-rw-r--r-- | stoc/test/testintrosp.cxx | 2 |
5 files changed, 23 insertions, 30 deletions
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx index 4bc0eb53acba..e329f63470d9 100644 --- a/stoc/source/corereflection/crarray.cxx +++ b/stoc/source/corereflection/crarray.cxx @@ -87,7 +87,7 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 nLen ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { TypeClass eTC = rArray.getValueTypeClass(); - if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) + if (eTC != TypeClass_SEQUENCE) { throw IllegalArgumentException( 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) { TypeClass eTC = rArray.getValueTypeClass(); - if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) + if (eTC != TypeClass_SEQUENCE) { throw IllegalArgumentException( 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) { TypeClass eTC = rArray.getValueTypeClass(); - if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) + if (eTC != TypeClass_SEQUENCE) { throw IllegalArgumentException( 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) { TypeClass eTC = rArray.getValueTypeClass(); - if (eTC != TypeClass_SEQUENCE && eTC != TypeClass_ARRAY) + if (eTC != TypeClass_SEQUENCE) { throw IllegalArgumentException( OUString("no sequence given!"), diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index cc437d08920b..1ba2ed44fb2d 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -208,11 +208,9 @@ inline Reference< XIdlClass > IdlReflectionServiceImpl::constructClass( return new EnumIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr ); case typelib_TypeClass_STRUCT: - case typelib_TypeClass_UNION: case typelib_TypeClass_EXCEPTION: return new CompoundIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr ); - case typelib_TypeClass_ARRAY: case typelib_TypeClass_SEQUENCE: return new ArrayIdlClassImpl( this, pTypeDescr->pTypeName, pTypeDescr->eTypeClass, pTypeDescr ); diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index b0c01c34e35d..19d235337797 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -521,9 +521,8 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy case TypeClass_ANY: return rVal; - // --- to STRUCT, UNION, EXCEPTION ---------------------------------------------------------- + // --- to STRUCT, EXCEPTION ---------------------------------------------------------- case TypeClass_STRUCT: -// case TypeClass_UNION: // xxx todo case TypeClass_EXCEPTION: { // same types or destination type is derived source type? @@ -700,22 +699,26 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina switch (aDestinationClass) { // only simple Conversion of _simple_ types - case TypeClass_INTERFACE: - case TypeClass_SERVICE: - case TypeClass_STRUCT: - case TypeClass_TYPEDEF: - case TypeClass_UNION: - case TypeClass_EXCEPTION: - case TypeClass_ARRAY: - case TypeClass_SEQUENCE: - case TypeClass_ENUM: - case TypeClass_UNKNOWN: - case TypeClass_MODULE: + case TypeClass_VOID: + case TypeClass_BOOLEAN: + case TypeClass_BYTE: + case TypeClass_SHORT: + case TypeClass_UNSIGNED_SHORT: + case TypeClass_LONG: + case TypeClass_UNSIGNED_LONG: + case TypeClass_HYPER: + case TypeClass_UNSIGNED_HYPER: + case TypeClass_FLOAT: + case TypeClass_DOUBLE: + case TypeClass_CHAR: + case TypeClass_STRING: + case TypeClass_ANY: + break; + + default: throw IllegalArgumentException( OUString("destination type is not simple!"), Reference< XInterface >(), (sal_Int16) 1 ); - default: - break; } Type aSourceType = rVal.getValueType(); diff --git a/stoc/test/testconv.cxx b/stoc/test/testconv.cxx index 415d3c596fed..79f06ab7efeb 100644 --- a/stoc/test/testconv.cxx +++ b/stoc/test/testconv.cxx @@ -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 ); // st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa // ==SEQ of ANY== - Sequence< Any > aAnySeq( 2 ), aAnySeq2( 2 ), aAnySeq3( 2 ); + Sequence< Any > aAnySeq( 2 ), aAnySeq2( 2 ); Any * pAnySeq = aAnySeq.getArray(); pAnySeq[0] = makeAny( aINT32Seq ); pAnySeq[1] = makeAny( OUString("lala") ); @@ -598,12 +598,6 @@ static sal_Int32 initBlocks( ConvBlock * pTestBlocks ) aVal <<= aAnySeq2; 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 - 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; } diff --git a/stoc/test/testintrosp.cxx b/stoc/test/testintrosp.cxx index f6d0860c798b..ef8192faddb7 100644 --- a/stoc/test/testintrosp.cxx +++ b/stoc/test/testintrosp.cxx @@ -103,10 +103,8 @@ OUString AnyToString( const Any& aValue, sal_Bool bIncludeType, const Reference< case TypeClass_SERVICE: aRetStr = "TYPE SERVICE"; break; case TypeClass_STRUCT: aRetStr = "TYPE STRUCT"; break; case TypeClass_TYPEDEF: aRetStr = "TYPE TYPEDEF"; break; - case TypeClass_UNION: aRetStr = "TYPE UNION"; break; case TypeClass_ENUM: aRetStr = "TYPE ENUM"; break; case TypeClass_EXCEPTION: aRetStr = "TYPE EXCEPTION"; break; - case TypeClass_ARRAY: aRetStr = "TYPE ARRAY"; break; case TypeClass_SEQUENCE: aRetStr = "TYPE SEQUENCE"; break; case TypeClass_VOID: aRetStr = "TYPE void"; break; case TypeClass_ANY: aRetStr = "TYPE any"; break; |