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,56 +2333,69 @@ void IUnknownWrapper_Impl::getPropDesc(const OUString & sFuncName, FUNCDESC ** p ...@@ -2333,56 +2333,69 @@ void IUnknownWrapper_Impl::getPropDesc(const OUString & sFuncName, FUNCDESC ** p
//else no entry for sFuncName, pFuncDesc will not be filled in //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 ); VARTYPE _type( VT_NULL );
if ( pTypeInfo )
if (desc->vt == VT_PTR)
{
_type = getElementTypeDesc(desc->lptdesc);
_type |= VT_BYREF;
}
else if (desc->vt == VT_SAFEARRAY)
{ {
_type = getElementTypeDesc(desc->lptdesc); CComPtr<ITypeInfo> spRefInfo;
_type |= VT_ARRAY; pTypeInfo->GetRefTypeInfo( nHrefType, &spRefInfo.p );
} if ( spRefInfo )
else if (desc->vt == VT_USERDEFINED)
{
ITypeInfo* thisInfo = getTypeInfo(); //kept by this instance
CComPtr<ITypeInfo> spRefInfo;
thisInfo->GetRefTypeInfo(desc->hreftype, & spRefInfo.p);
if (spRefInfo)
{ {
TypeAttr attr(spRefInfo); TypeAttr attr( spRefInfo );
spRefInfo->GetTypeAttr( & attr); spRefInfo->GetTypeAttr( &attr );
if (attr->typekind == TKIND_ENUM) if ( attr->typekind == TKIND_ENUM )
{ {
//We use the type of the first enum value. // We use the type of the first enum value.
if (attr->cVars == 0) if ( attr->cVars == 0 )
{ {
throw BridgeRuntimeError(OUSTR("[automation bridge] Could " throw BridgeRuntimeError(OUSTR("[automation bridge] Could not obtain type description"));
"not obtain type description"));
} }
VarDesc var(spRefInfo); VarDesc var( spRefInfo );
spRefInfo->GetVarDesc(0, & var); spRefInfo->GetVarDesc( 0, &var );
_type = var->lpvarValue->vt; _type = var->lpvarValue->vt;
} }
else if (attr->typekind == TKIND_INTERFACE) else if ( attr->typekind == TKIND_INTERFACE )
{ {
_type = VT_UNKNOWN; _type = VT_UNKNOWN;
} }
else if (attr->typekind == TKIND_DISPATCH) else if ( attr->typekind == TKIND_DISPATCH )
{ {
_type = VT_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 else
{ {
throw BridgeRuntimeError(OUSTR("[automation bridge] " throw BridgeRuntimeError( OUSTR("[automation bridge] Unhandled user defined type.") );
"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 else
{ {
_type = desc->vt; _type = desc->vt;
......
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