From 0d2b12deb5d2a78d795ac39b36d51170ef0439de Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Dec 2010 13:46:18 +0100 Subject: sb135: #i116043# handle extended InterfaceAttributeTypeDescription information --- cppuhelper/source/tdmgr.cxx | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'cppuhelper/source/tdmgr.cxx') diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx index 1174c1822fb6..4a8a88f2093a 100644 --- a/cppuhelper/source/tdmgr.cxx +++ b/cppuhelper/source/tdmgr.cxx @@ -27,6 +27,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_cppuhelper.hxx" + +#include "sal/config.h" + +#include + #include #include @@ -45,7 +50,7 @@ #include #include #include -#include +#include #include #include #include @@ -302,7 +307,7 @@ inline static typelib_TypeDescription * createCTD( } //================================================================================================== inline static typelib_TypeDescription * createCTD( - const Reference< XInterfaceAttributeTypeDescription > & xAttribute ) + const Reference< XInterfaceAttributeTypeDescription2 > & xAttribute ) { typelib_TypeDescription * pRet = 0; if (xAttribute.is()) @@ -310,14 +315,31 @@ inline static typelib_TypeDescription * createCTD( OUString aMemberName( xAttribute->getName() ); Reference< XTypeDescription > xType( xAttribute->getType() ); OUString aMemberTypeName( xType->getName() ); - - typelib_typedescription_newInterfaceAttribute( + std::vector< rtl_uString * > getExc; + Sequence< Reference< XCompoundTypeDescription > > getExcs( + xAttribute->getGetExceptions() ); + for (sal_Int32 i = 0; i != getExcs.getLength(); ++i) + { + OSL_ASSERT( getExcs[i].is() ); + getExc.push_back( getExcs[i]->getName().pData ); + } + std::vector< rtl_uString * > setExc; + Sequence< Reference< XCompoundTypeDescription > > setExcs( + xAttribute->getSetExceptions() ); + for (sal_Int32 i = 0; i != setExcs.getLength(); ++i) + { + OSL_ASSERT( setExcs[i].is() ); + setExc.push_back( setExcs[i]->getName().pData ); + } + typelib_typedescription_newExtendedInterfaceAttribute( (typelib_InterfaceAttributeTypeDescription **)&pRet, xAttribute->getPosition(), aMemberName.pData, // name (typelib_TypeClass)xType->getTypeClass(), aMemberTypeName.pData, // type name - xAttribute->isReadOnly() ); + xAttribute->isReadOnly(), + getExc.size(), getExc.empty() ? 0 : &getExc[0], + setExc.size(), setExc.empty() ? 0 : &setExc[0] ); } return pRet; } @@ -643,7 +665,7 @@ static typelib_TypeDescription * createCTD( pRet = createCTD( Reference< XInterfaceMethodTypeDescription >::query( xType ) ); break; case TypeClass_INTERFACE_ATTRIBUTE: - pRet = createCTD( Reference< XInterfaceAttributeTypeDescription >::query( xType ) ); + pRet = createCTD( Reference< XInterfaceAttributeTypeDescription2 >::query( xType ) ); break; default: break; -- cgit