summaryrefslogtreecommitdiff
path: root/extensions/source/ole
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2010-09-17 15:02:32 +0200
committerMikhail Voytenko <mav@openoffice.org>2010-09-17 15:02:32 +0200
commitbec3eba38478a711b19ac8a79b68bcf364eb45e0 (patch)
tree92457b846b50474b006e787bf6b19f1216dc9f3b /extensions/source/ole
parentadd870e4cb5b6ba3b7f1ccf23877e09dce6c248f (diff)
mib19: #163585# allow to use Any(void) as parameter
Diffstat (limited to 'extensions/source/ole')
-rwxr-xr-xextensions/source/ole/oleobjw.cxx24
1 files changed, 6 insertions, 18 deletions
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx
index 4ec4287754b8..ed62aa57ab23 100755
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -1860,22 +1860,6 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(const OUString& sFuncName,
throw IllegalArgumentException( buf.makeStringAndClear(),
Reference<XInterface>(), (sal_Int16) i);
}
- //make sure we get no void any for an in parameter. In StarBasic
- //this may be caused by
- // Dim arg
- // obj.func(arg)
- //A void any is allowed if the parameter is optional
- if ( ! (aFuncDesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOPT)
- && (i < nUnoArgs) && (paramFlags & PARAMFLAG_FIN) &&
- Params.getConstArray()[i].getValueTypeClass() == TypeClass_VOID)
- {
- OUStringBuffer buf(256);
- buf.appendAscii("ole automation bridge: The argument at position: ");
- buf.append(OUString::valueOf((sal_Int32) i));
- buf.appendAscii(" (index starts with 0) is uninitialized.");
- throw IllegalArgumentException( buf.makeStringAndClear(),
- Reference<XInterface>(), (sal_Int16) i);
- }
// Property Put arguments
if (anyArg.getValueType() == getCppuType((PropertyPutArgument*)0))
@@ -1988,12 +1972,16 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(const OUString& sFuncName,
& aFuncDesc->lprgelemdescParam[i].paramdesc.
pparamdescex->varDefaultValue);
}
- else
+ else if (paramFlags & PARAMFLAG_FOPT)
{
- OSL_ASSERT(paramFlags & PARAMFLAG_FOPT);
arArgs[revIndex].vt = VT_ERROR;
arArgs[revIndex].scode = DISP_E_PARAMNOTFOUND;
}
+ else
+ {
+ arArgs[revIndex].vt = VT_EMPTY;
+ arArgs[revIndex].lVal = 0;
+ }
}
}
}