summaryrefslogtreecommitdiff
path: root/basic/source/classes
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2024-08-29 13:52:06 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2024-09-20 16:56:34 +0200
commit4506cd04c78baf628c8c6fd7e9c5f27a407d8f87 (patch)
tree8153ae35b45c394a8953b99c016fd0ca9cd0d743 /basic/source/classes
parentf231ca7a43c7ac6d31973eb45168f2dd87f694bd (diff)
tdf#162431 - Check for missing parameters
Don't silently convert missing parameters including their error code to the request target typen when the target type can't handle the conversion. Change-Id: I2300aa594ae3cc1045a6397c1195718b6662aa61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172593 Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Jenkins
Diffstat (limited to 'basic/source/classes')
-rw-r--r--basic/source/classes/sbunoobj.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 4ead3c8cd1d1..bede3ce759eb 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -1186,6 +1186,15 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn
}
TypeClass eType = rType.getTypeClass();
+
+ // tdf#162431 - check for missing parameters
+ if (eType != TypeClass_ANY && eType != TypeClass_VOID && pVar->GetType() == SbxERROR)
+ {
+ SbxVariable* paSbxVariable = dynamic_cast<SbxVariable*>(const_cast<SbxValue*>(pVar));
+ if (paSbxVariable && SbiRuntime::IsMissing(paSbxVariable, 1))
+ StarBASIC::Error(ERRCODE_BASIC_NOT_OPTIONAL);
+ }
+
switch( eType )
{
case TypeClass_INTERFACE: