Kaydet (Commit) b0fa5081 authored tarafından Steve Yin's avatar Steve Yin

Bug 123816 - Cannot send email with attachment via VBA code taking Notes as mail application

üst d12312e8
......@@ -2333,55 +2333,68 @@ void IUnknownWrapper_Impl::getPropDesc(const OUString & sFuncName, FUNCDESC ** p
//else no entry for sFuncName, pFuncDesc will not be filled in
}
VARTYPE IUnknownWrapper_Impl::getElementTypeDesc(const TYPEDESC *desc)
VARTYPE lcl_getUserDefinedElementType( ITypeInfo* pTypeInfo, const DWORD nHrefType )
{
VARTYPE _type( VT_NULL );
if (desc->vt == VT_PTR)
{
_type = getElementTypeDesc(desc->lptdesc);
_type |= VT_BYREF;
}
else if (desc->vt == VT_SAFEARRAY)
if ( pTypeInfo )
{
_type = getElementTypeDesc(desc->lptdesc);
_type |= VT_ARRAY;
}
else if (desc->vt == VT_USERDEFINED)
{
ITypeInfo* thisInfo = getTypeInfo(); //kept by this instance
CComPtr<ITypeInfo> spRefInfo;
thisInfo->GetRefTypeInfo(desc->hreftype, & spRefInfo.p);
if (spRefInfo)
pTypeInfo->GetRefTypeInfo( nHrefType, &spRefInfo.p );
if ( spRefInfo )
{
TypeAttr attr(spRefInfo);
spRefInfo->GetTypeAttr( & attr);
if (attr->typekind == TKIND_ENUM)
TypeAttr attr( spRefInfo );
spRefInfo->GetTypeAttr( &attr );
if ( attr->typekind == TKIND_ENUM )
{
//We use the type of the first enum value.
if (attr->cVars == 0)
// We use the type of the first enum value.
if ( attr->cVars == 0 )
{
throw BridgeRuntimeError(OUSTR("[automation bridge] Could "
"not obtain type description"));
throw BridgeRuntimeError(OUSTR("[automation bridge] Could not obtain type description"));
}
VarDesc var(spRefInfo);
spRefInfo->GetVarDesc(0, & var);
VarDesc var( spRefInfo );
spRefInfo->GetVarDesc( 0, &var );
_type = var->lpvarValue->vt;
}
else if (attr->typekind == TKIND_INTERFACE)
else if ( attr->typekind == TKIND_INTERFACE )
{
_type = VT_UNKNOWN;
}
else if (attr->typekind == TKIND_DISPATCH)
else if ( attr->typekind == TKIND_DISPATCH )
{
_type = VT_DISPATCH;
}
else if ( attr->typekind == TKIND_ALIAS )
{
// TKIND_ALIAS is a type that is an alias for another type. So get that alias type.
_type = lcl_getUserDefinedElementType( pTypeInfo, attr->tdescAlias.hreftype );
}
else
{
throw BridgeRuntimeError(OUSTR("[automation bridge] "
"Unhandled user defined type."));
throw BridgeRuntimeError( OUSTR("[automation bridge] Unhandled user defined type.") );
}
}
}
return _type;
}
VARTYPE IUnknownWrapper_Impl::getElementTypeDesc(const TYPEDESC *desc)
{
VARTYPE _type( VT_NULL );
if (desc->vt == VT_PTR)
{
_type = getElementTypeDesc(desc->lptdesc);
_type |= VT_BYREF;
}
else if (desc->vt == VT_SAFEARRAY)
{
_type = getElementTypeDesc(desc->lptdesc);
_type |= VT_ARRAY;
}
else if (desc->vt == VT_USERDEFINED)
{
ITypeInfo* thisInfo = getTypeInfo(); //kept by this instance
_type = lcl_getUserDefinedElementType( thisInfo, desc->hreftype );
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment