36#include <rtl/math.hxx>
37#include <rtl/ustrbuf.hxx>
39#include <com/sun/star/script/ArrayWrapper.hpp>
40#include <com/sun/star/script/CannotConvertException.hpp>
41#include <com/sun/star/script/NativeObjectWrapper.hpp>
43#include <com/sun/star/uno/XComponentContext.hpp>
44#include <com/sun/star/uno/DeploymentException.hpp>
45#include <com/sun/star/lang/XTypeProvider.hpp>
46#include <com/sun/star/lang/XSingleServiceFactory.hpp>
47#include <com/sun/star/lang/XMultiServiceFactory.hpp>
48#include <com/sun/star/lang/XServiceInfo.hpp>
49#include <com/sun/star/beans/PropertyAttribute.hpp>
50#include <com/sun/star/beans/PropertyConcept.hpp>
51#include <com/sun/star/beans/MethodConcept.hpp>
52#include <com/sun/star/beans/XPropertySet.hpp>
53#include <com/sun/star/beans/theIntrospection.hpp>
54#include <com/sun/star/script/BasicErrorException.hpp>
55#include <com/sun/star/script/InvocationAdapterFactory.hpp>
56#include <com/sun/star/script/XAllListener.hpp>
57#include <com/sun/star/script/Converter.hpp>
58#include <com/sun/star/script/XDefaultProperty.hpp>
59#include <com/sun/star/script/XDirectInvocation.hpp>
60#include <com/sun/star/container/XNameAccess.hpp>
61#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
62#include <com/sun/star/reflection/XIdlArray.hpp>
63#include <com/sun/star/reflection/XIdlReflection.hpp>
64#include <com/sun/star/reflection/XServiceConstructorDescription.hpp>
65#include <com/sun/star/reflection/XSingletonTypeDescription.hpp>
66#include <com/sun/star/reflection/theCoreReflection.hpp>
67#include <com/sun/star/bridge/oleautomation/NamedArgument.hpp>
68#include <com/sun/star/bridge/oleautomation/Date.hpp>
69#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
70#include <com/sun/star/bridge/oleautomation/Currency.hpp>
71#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
72#include <com/sun/star/script/XAutomationInvocation.hpp>
87#include <unordered_map>
88#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
89#include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
115 bool bResult =
false;
117 if ( xDefaultProp.is() )
119 sDfltProp = xDefaultProp->getDefaultPropertyName();
120 if ( !sDfltProp.isEmpty() )
135 pObj =
dynamic_cast<SbxObject*
>( pObjVarObj );
139 pDefaultProp = pUnoObj->GetDfltProperty();
150 OUString sDfltPropName;
162 return css::reflection::theCoreReflection::get(
171 if( !xCoreReflection_HierarchicalNameAccess.is() )
176 xCoreReflection_HierarchicalNameAccess =
180 return xCoreReflection_HierarchicalNameAccess;
195 xContext->getValueByName(
196 "/singletons/com.sun.star.reflection.theTypeDescriptionManager" )
198 OSL_ENSURE( xAccess.is(),
"### TypeDescriptionManager singleton not accessible!?" );
202 throw DeploymentException(
203 "/singletons/com.sun.star.reflection.theTypeDescriptionManager singleton not accessible" );
225 throw DeploymentException(
226 "com.sun.star.script.Converter service not accessible" );
243 xSMgr->createInstanceWithContext(
"com.sun.star.bridge.OleObjectFactory", xContext ),
250 if( xOLEFactory.is() )
253 OUString aOLEType = aType;
254 if ( aOLEType ==
"SAXXMLReader30" )
256 aOLEType =
"Msxml2.SAXXMLReader.3.0";
259 if( xOLEObject.is() )
262 OUString sDfltPropName;
274 void lcl_indent( OUStringBuffer& _inout_rBuffer, sal_Int32 _nLevel )
276 while ( _nLevel-- > 0 )
278 _inout_rBuffer.append(
" " );
283static void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer,
const Exception& _e, std::u16string_view _rExceptionType, sal_Int32 _nLevel )
285 _inout_rBuffer.append(
"\n" );
286 lcl_indent( _inout_rBuffer, _nLevel );
287 _inout_rBuffer.append(
"Type: " );
289 if ( _rExceptionType.empty() )
290 _inout_rBuffer.append(
"Unknown" );
292 _inout_rBuffer.append( _rExceptionType );
294 _inout_rBuffer.append(
"\n" );
295 lcl_indent( _inout_rBuffer, _nLevel );
296 _inout_rBuffer.append(
"Message: " );
297 _inout_rBuffer.append( _e.Message );
304 OUStringBuffer aMessageBuf;
306 return aMessageBuf.makeStringAndClear();
311 auto e = o3tl::tryAccess<Exception>(_rCaughtException);
312 OSL_PRECOND( e,
"implGetExceptionMsg: illegal argument!" );
326 aConvertedVal =
xConverter->convertTo( rVal, aDestType );
328 catch(
const IllegalArgumentException& )
332 return aConvertedVal;
334 catch(
const CannotConvertException& e2 )
338 return aConvertedVal;
340 return aConvertedVal;
354template<
class EXCEPTION >
368 Any aExamine( _rWrappedTargetException );
372 InvocationTargetException aInvocationError;
373 if ( aExamine >>= aInvocationError )
374 aExamine = aInvocationError.TargetException;
376 BasicErrorException aBasicError;
379 OUStringBuffer aMessageBuf;
382 WrappedTargetException aWrapped;
383 sal_Int32 nLevel = 0;
384 while ( aExamine >>= aWrapped )
387 if ( aWrapped.TargetException >>= aBasicError )
390 aMessageBuf.append( aBasicError.ErrorMessageArgument );
397 if ( aWrapped.TargetException.getValueTypeClass() == TypeClass_EXCEPTION )
399 aMessageBuf.append(
"\nTargetException:" );
402 aExamine = aWrapped.TargetException;
406 if (
auto e = o3tl::tryAccess<Exception>(aExamine) )
417 BasicErrorException aBasicError;
418 WrappedTargetException aWrappedError;
420 if ( _rCaughtException >>= aBasicError )
424 else if ( _rCaughtException >>= aWrappedError )
441 explicit ObjectItem(
SbxObject* pNativeObj )
442 : m_xNativeObj( pNativeObj )
458 gaNativeObjectWrapperVector.clear();
463 sal_uInt32
nIndex = gaNativeObjectWrapperVector.size();
464 gaNativeObjectWrapperVector.emplace_back( pNativeObj );
471 if(
nIndex < gaNativeObjectWrapperVector.size() )
473 ObjectItem& rItem = gaNativeObjectWrapperVector[
nIndex ];
474 xRetObj = rItem.m_xNativeObj;
476 return xRetObj.
get();
486 case TypeClass_INTERFACE:
488 case TypeClass_STRUCT:
489 case TypeClass_EXCEPTION: eRetType =
SbxOBJECT;
break;
491 case TypeClass_ENUM: eRetType =
SbxLONG;
break;
492 case TypeClass_SEQUENCE:
497 case TypeClass_ANY: eRetType =
SbxVARIANT;
break;
498 case TypeClass_BOOLEAN: eRetType =
SbxBOOL;
break;
499 case TypeClass_CHAR: eRetType =
SbxCHAR;
break;
500 case TypeClass_STRING: eRetType =
SbxSTRING;
break;
501 case TypeClass_FLOAT: eRetType =
SbxSINGLE;
break;
502 case TypeClass_DOUBLE: eRetType =
SbxDOUBLE;
break;
503 case TypeClass_BYTE: eRetType =
SbxINTEGER;
break;
504 case TypeClass_SHORT: eRetType =
SbxINTEGER;
break;
505 case TypeClass_LONG: eRetType =
SbxLONG;
break;
506 case TypeClass_HYPER: eRetType =
SbxSALINT64;
break;
507 case TypeClass_UNSIGNED_SHORT: eRetType =
SbxUSHORT;
break;
508 case TypeClass_UNSIGNED_LONG: eRetType =
SbxULONG;
break;
509 case TypeClass_UNSIGNED_HYPER: eRetType =
SbxSALUINT64;
break;
520 TypeClass
eType = xIdlClass->getTypeClass();
528 const Type& aType = aValue.getValueType();
529 TypeClass eTypeClass = aType.getTypeClass();
531 sal_Int32 dimCopy = dimension;
533 if ( eTypeClass == TypeClass_SEQUENCE )
538 aType.getDescription( &pTD );
539 Type aElementType(
reinterpret_cast<typelib_IndirectTypeDescription *
>(pTD)->pType );
540 ::typelib_typedescription_release( pTD );
542 sal_Int32 nLen = xIdlArray->getLen( aValue );
545 auto pindices = indices.getArray();
546 Any aElementAny = xIdlArray->get( aValue,
static_cast<sal_uInt32
>(
index) );
548 if ( dimCopy == dimension )
551 if ( sizes.getLength() < dimCopy )
553 sizes.realloc( sizes.getLength() + 1 );
554 sizes.getArray()[ sizes.getLength() - 1 ] = nLen;
555 indices.realloc( indices.getLength() + 1 );
556 pindices = indices.getArray();
561 pindices[ dimCopy - 1 ] =
index;
563 pindices[ dimCopy - 1] =
index + 1;
571 if ( !indices.hasElements() )
585 sal_Int32 nIndexLen = indices.getLength();
600 auto xVar = tools::make_ref<SbxVariable>( eSbxElementType );
603 sal_Int32* pIndices = indices.getArray();
604 pArray->
Put(xVar.get(), pIndices);
612 const Type& aType = aValue.getValueType();
613 TypeClass eTypeClass = aType.getTypeClass();
623 aClassAny <<= xClass;
630 if( !pSbUnoObject->
getUnoAny().hasValue() )
641 case TypeClass_INTERFACE:
642 case TypeClass_STRUCT:
643 case TypeClass_EXCEPTION:
645 if( eTypeClass == TypeClass_STRUCT )
648 NativeObjectWrapper aNativeObjectWrapper;
649 if ( aValue >>= aWrap )
667 else if ( aValue >>= aNativeObjectWrapper )
670 if( aNativeObjectWrapper.ObjectId >>=
nIndex )
684 oleautomation::Date aDate;
685 if( aValue >>= aDate )
692 oleautomation::Decimal aDecimal;
693 if( aValue >>= aDecimal )
700 oleautomation::Currency aCurrency;
701 if( aValue >>= aCurrency )
719 OUString sDfltPropName;
729 if( !pSbUnoObject->
getUnoAny().hasValue() )
749 case TypeClass_SEQUENCE:
753 sal_Int32
i, nLen = xIdlArray->getLen( aValue );
756 aType.getDescription( &pTD );
757 assert( pTD && pTD->eTypeClass == typelib_TypeClass_SEQUENCE );
758 Type aElementType(
reinterpret_cast<typelib_IndirectTypeDescription *
>(pTD)->pType );
759 ::typelib_typedescription_release( pTD );
767 xArray->unoAddDim(0, nLen - 1);
770 for(
i = 0 ;
i < nLen ;
i++ )
773 Any aElementAny = xIdlArray->get( aValue,
static_cast<sal_uInt32
>(
i) );
774 auto xVar = tools::make_ref<SbxVariable>( eSbxElementType );
778 xArray->Put(xVar.get(), &
i);
783 xArray->unoAddDim(0, -1);
796 case TypeClass_BOOLEAN: pVar->
PutBool( *o3tl::forceAccess<bool>(aValue) );
break;
799 pVar->
PutChar( *o3tl::forceAccess<sal_Unicode>(aValue) );
802 case TypeClass_STRING: { OUString val; aValue >>= val; pVar->
PutString( val ); }
break;
803 case TypeClass_FLOAT: {
float val = 0; aValue >>= val; pVar->
PutSingle( val ); }
break;
804 case TypeClass_DOUBLE: {
double val = 0; aValue >>= val; pVar->
PutDouble( val ); }
break;
805 case TypeClass_BYTE: {
sal_Int8 val = 0; aValue >>= val; pVar->
PutInteger( val ); }
break;
806 case TypeClass_SHORT: { sal_Int16 val = 0; aValue >>= val; pVar->
PutInteger( val ); }
break;
807 case TypeClass_LONG: { sal_Int32 val = 0; aValue >>= val; pVar->
PutLong( val ); }
break;
808 case TypeClass_HYPER: { sal_Int64 val = 0; aValue >>= val; pVar->
PutInt64( val ); }
break;
809 case TypeClass_UNSIGNED_SHORT: { sal_uInt16 val = 0; aValue >>= val; pVar->
PutUShort( val ); }
break;
810 case TypeClass_UNSIGNED_LONG: { sal_uInt32 val = 0; aValue >>= val; pVar->
PutULong( val ); }
break;
811 case TypeClass_UNSIGNED_HYPER: { sal_uInt64 val = 0; aValue >>= val; pVar->
PutUInt64( val ); }
break;
872 sal_Int32 nDims = pArray->GetDims();
874 TypeClass eElementTypeClass = aElementType.getTypeClass();
877 sal_Int32 nLower, nUpper;
878 if (nDims == 1 && pArray->GetDim(1, nLower, nUpper))
880 if( eElementTypeClass == TypeClass_VOID || eElementTypeClass == TypeClass_ANY )
884 bool bNeedsInit =
true;
886 for (sal_Int32 aIdx[1] = { nLower }; aIdx[0] <= nUpper; ++aIdx[0])
892 if( aType.getTypeClass() == TypeClass_VOID )
899 aElementType = aType;
902 else if( aElementType != aType )
911 OUString aSeqTypeName =
aSeqLevelStr + aElementType.getTypeName();
912 aRetType =
Type( TypeClass_SEQUENCE, aSeqTypeName );
917 if( eElementTypeClass == TypeClass_VOID || eElementTypeClass == TypeClass_ANY )
920 sal_uInt32 nFlatArraySize = pArray->Count();
922 bool bNeedsInit =
true;
923 for( sal_uInt32
i = 0 ;
i < nFlatArraySize ;
i++ )
929 if( aType.getTypeClass() == TypeClass_VOID )
936 aElementType = aType;
939 else if( aElementType != aType )
948 OUStringBuffer aSeqTypeName;
949 for(sal_Int32 iDim = 0 ; iDim < nDims ; iDim++ )
953 aSeqTypeName.append(aElementType.getTypeName());
954 aRetType =
Type( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() );
960 aRetType = obj->getUnoAny().getValueType();
965 aRetType =
any->getValue().getValueType();
993 return obj->getValue();
994 if(
auto pClassModuleObj =
dynamic_cast<SbClassModuleObject*
>( xObj.
get() ) )
997 SbModule* pClassModule = pClassModuleObj->getClassModule();
1005 if( pObj !=
nullptr )
1007 NativeObjectWrapper aNativeObjectWrapper;
1009 aNativeObjectWrapper.ObjectId <<=
nIndex;
1011 aRetAny <<= aNativeObjectWrapper;
1019 TypeClass
eType = aType.getTypeClass();
1021 if( !bBlockConversionToSmallestType )
1027 case TypeClass_FLOAT:
1028 case TypeClass_DOUBLE:
1031 if( rtl::math::approxEqual(
d, floor(
d )) )
1033 if(
d >= -128 &&
d <= 127 )
1042 case TypeClass_SHORT:
1045 if(
n >= -128 &&
n <= 127 )
1049 case TypeClass_LONG:
1052 if(
n >= -128 &&
n <= 127 )
1058 case TypeClass_UNSIGNED_LONG:
1076 const Type& aElemType, sal_Int32 nMaxDimIndex, sal_Int32 nActualDim,
1077 sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds )
1079 sal_Int32 nSeqLevel = nMaxDimIndex - nActualDim + 1;
1080 OUStringBuffer aSeqTypeName;
1082 for(
i = 0 ;
i < nSeqLevel ;
i++ )
1086 aSeqTypeName.append(aElemType.getTypeName());
1087 Type aSeqType( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() );
1092 xIdlTargetClass->createObject( aRetVal );
1095 sal_Int32 nUpper = pUpperBounds[nActualDim];
1096 sal_Int32 nLower = pLowerBounds[nActualDim];
1097 sal_Int32 nSeqSize = nUpper - nLower + 1;
1099 xArray->realloc( aRetVal, nSeqSize );
1101 sal_Int32& ri = pActualIndices[nActualDim];
1103 for( ri = nLower,
i = 0 ; ri <= nUpper ; ri++,
i++ )
1107 if( nActualDim < nMaxDimIndex )
1110 nMaxDimIndex, nActualDim + 1, pActualIndices, pLowerBounds, pUpperBounds );
1121 xArray->set( aRetVal,
i, aElementVal );
1123 catch(
const IllegalArgumentException& )
1128 catch (
const IndexOutOfBoundsException&)
1146 bool bSuccess =
false;
1149 if( xTypeAccess->hasByHierarchicalName( rName ) )
1151 Any aRet = xTypeAccess->getByHierarchicalName( rName );
1155 if( xTypeDesc.is() )
1157 rRetType =
Type( xTypeDesc->getTypeClass(), xTypeDesc->getName() );
1171 if( pUnoProperty && pUnoProperty->Attributes & PropertyAttribute::MAYBEVOID )
1177 SbxDataType eBaseType = pVar->SbxValue::GetType();
1183 return obj->getValue();
1187 TypeClass
eType = rType.getTypeClass();
1190 case TypeClass_INTERFACE:
1191 case TypeClass_STRUCT:
1192 case TypeClass_EXCEPTION:
1197 if( pVar->
IsNull() &&
eType == TypeClass_INTERFACE )
1200 OUString aClassName = xIdlTargetClass->getName();
1201 Type aClassType( xIdlTargetClass->getTypeClass(), aClassName );
1202 aRetVal.setValue( &xRef, aClassType );
1207 if(
eType == TypeClass_STRUCT )
1214 oleautomation::Decimal aDecimal;
1216 aRetVal <<= aDecimal;
1227 oleautomation::Date aDate;
1228 aDate.Value = pVar->
GetDate();
1238 aRetVal = obj->getUnoAny();
1242 aRetVal = structRef->getUnoAny();
1254 case TypeClass_TYPE:
1264 Any aUnoAny = obj->getUnoAny();
1265 aUnoAny >>= xIdlClass;
1268 if( xIdlClass.is() )
1270 OUString aClassName = xIdlClass->getName();
1271 Type aType( xIdlClass->getTypeClass(), aClassName );
1289 case TypeClass_ENUM:
1295 case TypeClass_SEQUENCE:
1300 sal_Int32 nDims = pArray->GetDims();
1303 sal_Int32 nLower, nUpper;
1304 if (nDims == 1 && pArray->GetDim(1, nLower, nUpper))
1306 sal_Int32 nSeqSize = nUpper - nLower + 1;
1310 xIdlTargetClass->createObject( aRetVal );
1312 xArray->realloc( aRetVal, nSeqSize );
1315 OUString aClassName = xIdlTargetClass->getName();
1319 Type aElemType(
reinterpret_cast<typelib_IndirectTypeDescription *
>(pSeqTD)->pType );
1324 for (sal_Int32
i = 0 ;
i < nSeqSize; ++
i, ++aIdx[0])
1334 xArray->set( aRetVal,
i, aAnyValue );
1336 catch(
const IllegalArgumentException& )
1341 catch (
const IndexOutOfBoundsException&)
1348 else if( nDims > 1 )
1352 Type aCurType( rType );
1353 sal_Int32 nSeqLevel = 0;
1357 OUString aTypeName = aCurType.getTypeName();
1360 if( pSeqTD->eTypeClass == typelib_TypeClass_SEQUENCE )
1362 aCurType =
Type(
reinterpret_cast<typelib_IndirectTypeDescription *
>(pSeqTD)->pType );
1367 aElemType = aCurType;
1373 if( nSeqLevel == nDims )
1375 std::unique_ptr<sal_Int32[]> pLowerBounds(
new sal_Int32[nDims]);
1376 std::unique_ptr<sal_Int32[]> pUpperBounds(
new sal_Int32[nDims]);
1377 std::unique_ptr<sal_Int32[]> pActualIndices(
new sal_Int32[nDims]);
1378 for(sal_Int32
i = 1 ;
i <= nDims ;
i++ )
1380 sal_Int32 lBound, uBound;
1381 pArray->GetDim(
i, lBound, uBound);
1383 sal_Int32 j =
i - 1;
1384 pActualIndices[j] = pLowerBounds[j] = lBound;
1385 pUpperBounds[j] = uBound;
1389 nDims - 1, 0, pActualIndices.get(), pLowerBounds.get(), pUpperBounds.get() );
1404 case TypeClass_BOOLEAN:
1409 case TypeClass_CHAR:
1414 case TypeClass_STRING: aRetVal <<= pVar->
GetOUString();
break;
1415 case TypeClass_FLOAT: aRetVal <<= pVar->
GetSingle();
break;
1416 case TypeClass_DOUBLE: aRetVal <<= pVar->
GetDouble();
break;
1418 case TypeClass_BYTE:
1421 bool bOverflow =
false;
1427 else if( nVal > 255 )
1436 aRetVal <<= nByteVal;
1439 case TypeClass_SHORT: aRetVal <<= pVar->
GetInteger();
break;
1440 case TypeClass_LONG: aRetVal <<= pVar->
GetLong();
break;
1441 case TypeClass_HYPER: aRetVal <<= pVar->
GetInt64();
break;
1442 case TypeClass_UNSIGNED_SHORT: aRetVal <<= pVar->
GetUShort();
break;
1443 case TypeClass_UNSIGNED_LONG: aRetVal <<= pVar->
GetULong();
break;
1444 case TypeClass_UNSIGNED_HYPER: aRetVal <<= pVar->
GetUInt64();
break;
1455 args.realloc( nParamCount );
1456 Any* pAnyArgs =
args.getArray();
1459 if( pArgNamesArray )
1462 OUString* pNames = rNameSeq.getArray();
1464 for(
i = 0 ;
i < nParamCount ;
i++ )
1466 sal_uInt32 iSbx =
i + 1;
1469 bBlockConversionToSmallestType );
1471 OUString aParamName = pNames[iSbx];
1472 if( !aParamName.isEmpty() )
1474 oleautomation::NamedArgument aNamedArgument;
1475 aNamedArgument.Name = aParamName;
1476 aNamedArgument.Value = aValAny;
1477 pAnyArgs[
i] <<= aNamedArgument;
1481 pAnyArgs[
i] = aValAny;
1487 for(
i = 0 ;
i < nParamCount ;
i++ )
1490 bBlockConversionToSmallestType );
1498enum class INVOKETYPE
1512 switch( invokeType )
1514 case INVOKETYPE::Func:
1515 aRetAny = rxInvocation->invoke(
Name,
args, OutParamIndex, OutParam );
1517 case INVOKETYPE::GetProp:
1520 aRetAny = xAutoInv->invokeGetProperty(
Name,
args, OutParamIndex, OutParam );
1524 assert(
false);
break;
1527 const sal_Int16* pIndices = OutParamIndex.getConstArray();
1528 sal_uInt32 nLen = OutParamIndex.getLength();
1531 const Any* pNewValues = OutParam.getConstArray();
1532 for( sal_uInt32 j = 0 ; j < nLen ; j++ )
1534 sal_Int16 iTarget = pIndices[ j ];
1549 OUStringBuffer aRetStr;
1550 for( sal_uInt16
i = 0 ;
i < nRekLevel ;
i++ )
1551 aRetStr.append(
" " );
1552 aRetStr.append( xClass->getName() );
1553 OUString aClassName = xClass->getName();
1554 Type aClassType( xClass->getTypeClass(), aClassName );
1557 if( !
x->queryInterface( aClassType ).hasValue() )
1559 aRetStr.append(
" (ERROR: Not really supported!)\n" );
1564 aRetStr.append(
"\n" );
1569 sal_uInt32 nSuperIfaceCount = aSuperClassSeq.getLength();
1570 for( sal_uInt32 j = 0 ; j < nSuperIfaceCount ; j++ )
1573 if( !rxIfaceClass->equals( xIfaceClass ) )
1577 return aRetStr.makeStringAndClear();
1583 if(
aName.isEmpty() )
1590 if( xServiceInfo.is() )
1591 aName = xServiceInfo->getImplementationName();
1600 if(
aName.isEmpty() )
1603 OUStringBuffer aRet;
1604 if(
aName.getLength() > 20 )
1606 aRet.append(
"\n" );
1608 aRet.append(
"\"" +
aName +
"\":" );
1609 return aRet.makeStringAndClear();
1622 return pUnoStructObj->GetClassName();
1630bool matchesBasicTypeName(
1631 css::uno::Reference<css::reflection::XIdlClass>
const & unoType, OUString
const & basicTypeName)
1633 if (unoType->getName().endsWithIgnoreAsciiCase(basicTypeName)) {
1636 auto const sups = unoType->getSuperclasses();
1638 sups.begin(), sups.end(),
1639 [&basicTypeName](
auto const & t) { return matchesBasicTypeName(t, basicTypeName); });
1654 bool bResult =
false;
1656 if( xTypeProvider.is() )
1666 OUString aClassName;
1670 sal_Int32 nClassNameDot = rClass.lastIndexOf(
'.' );
1671 if( nClassNameDot >= 0 )
1673 aClassName += OUString::Concat(rClass.subView( 0, nClassNameDot + 1 )) +
"X" + rClass.subView( nClassNameDot + 1 );
1677 aClassName +=
"X" + rClass;
1682 aClassName = rClass;
1685 const Type* pTypeArray = aTypeSeq.getConstArray();
1686 sal_uInt32 nIfaceCount = aTypeSeq.getLength();
1687 for( sal_uInt32 j = 0 ; j < nIfaceCount ; j++ )
1689 const Type& rType = pTypeArray[j];
1694 OSL_FAIL(
"failed to get XIdlClass for type");
1697 OUString aInterfaceName = xClass->getName();
1698 if ( aInterfaceName ==
"com.sun.star.bridge.oleautomation.XAutomationObject" )
1706 xInv->getValue(
"$GetTypeName" ) >>= sTypeName;
1707 if ( sTypeName.isEmpty() || sTypeName ==
"IDispatch" )
1714 bResult = sTypeName == rClass;
1720 if ( matchesBasicTypeName(xClass, aClassName) )
1736 OUStringBuffer aRet;
1737 auto x = o3tl::tryAccess<Reference<XInterface>>(aToInspectObj);
1741 +
" not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
1747 aRet.append(
"Supported interfaces by object "
1750 if( xTypeProvider.is() )
1754 const Type* pTypeArray = aTypeSeq.getConstArray();
1755 sal_uInt32 nIfaceCount = aTypeSeq.getLength();
1756 for( sal_uInt32 j = 0 ; j < nIfaceCount ; j++ )
1758 const Type& rType = pTypeArray[j];
1768 rType.getDescription( &pTD );
1770 aRet.append( OUString::Concat(
"*** ERROR: No IdlClass for type \"")
1771 + OUString::unacquired(&pTD->pTypeName)
1772 +
"\"\n*** Please check type library\n" );
1777 return aRet.makeStringAndClear();
1784 OUStringBuffer aRet;
1787 case SbxEMPTY: aRet.append(
"SbxEMPTY");
break;
1788 case SbxNULL: aRet.append(
"SbxNULL");
break;
1789 case SbxINTEGER: aRet.append(
"SbxINTEGER");
break;
1790 case SbxLONG: aRet.append(
"SbxLONG");
break;
1791 case SbxSINGLE: aRet.append(
"SbxSINGLE");
break;
1792 case SbxDOUBLE: aRet.append(
"SbxDOUBLE");
break;
1793 case SbxCURRENCY: aRet.append(
"SbxCURRENCY");
break;
1794 case SbxDECIMAL: aRet.append(
"SbxDECIMAL");
break;
1795 case SbxDATE: aRet.append(
"SbxDATE");
break;
1796 case SbxSTRING: aRet.append(
"SbxSTRING");
break;
1797 case SbxOBJECT: aRet.append(
"SbxOBJECT");
break;
1798 case SbxERROR: aRet.append(
"SbxERROR");
break;
1799 case SbxBOOL: aRet.append(
"SbxBOOL");
break;
1800 case SbxVARIANT: aRet.append(
"SbxVARIANT");
break;
1802 case SbxCHAR: aRet.append(
"SbxCHAR");
break;
1803 case SbxBYTE: aRet.append(
"SbxBYTE");
break;
1804 case SbxUSHORT: aRet.append(
"SbxUSHORT");
break;
1805 case SbxULONG: aRet.append(
"SbxULONG");
break;
1808 case SbxINT: aRet.append(
"SbxINT");
break;
1809 case SbxUINT: aRet.append(
"SbxUINT");
break;
1810 case SbxVOID: aRet.append(
"SbxVOID");
break;
1811 case SbxHRESULT: aRet.append(
"SbxHRESULT");
break;
1812 case SbxPOINTER: aRet.append(
"SbxPOINTER");
break;
1813 case SbxDIMARRAY: aRet.append(
"SbxDIMARRAY");
break;
1814 case SbxCARRAY: aRet.append(
"SbxCARRAY");
break;
1815 case SbxUSERDEF: aRet.append(
"SbxUSERDEF");
break;
1816 case SbxLPSTR: aRet.append(
"SbxLPSTR");
break;
1817 case SbxLPWSTR: aRet.append(
"SbxLPWSTR");
break;
1820 default: aRet.append(
"Unknown Sbx-Type!");
break;
1822 return aRet.makeStringAndClear();
1836 xAccess = xInvok->getIntrospection();
1840 aRet.append(
"\nUnknown, no introspection available\n" );
1841 return aRet.makeStringAndClear();
1845 sal_uInt32 nUnoPropCount =
props.getLength();
1849 sal_uInt32 nPropCount = pProps->
Count();
1850 sal_uInt32 nPropsPerLine = 1 + nPropCount / 30;
1851 for( sal_uInt32
i = 0;
i < nPropCount;
i++ )
1856 OUStringBuffer aPropStr;
1857 if( (
i % nPropsPerLine) == 0 )
1858 aPropStr.append(
"\n" );
1864 bool bMaybeVoid =
false;
1865 if(
i < nUnoPropCount )
1871 if( rProp.Attributes & PropertyAttribute::MAYBEVOID )
1878 Type aType = rProp.Type;
1879 if( aType.getTypeClass() == TypeClass_SEQUENCE )
1885 aPropStr.append(
"/void" );
1886 aPropStr.append(
" " + pVar->
GetName() );
1888 if(
i == nPropCount - 1 )
1889 aPropStr.append(
"\n" );
1891 aPropStr.append(
"; " );
1893 aRet.append( aPropStr );
1896 return aRet.makeStringAndClear();
1910 xAccess = xInvok->getIntrospection();
1914 aRet.append(
"\nUnknown, no introspection available\n" );
1915 return aRet.makeStringAndClear();
1918 ( MethodConcept::ALL - MethodConcept::DANGEROUS );
1922 sal_uInt32 nMethodCount = pMethods->
Count();
1925 aRet.append(
"\nNo methods found\n" );
1926 return aRet.makeStringAndClear();
1928 sal_uInt32 nPropsPerLine = 1 + nMethodCount / 30;
1929 for( sal_uInt32
i = 0;
i < nMethodCount;
i++ )
1934 if( (
i % nPropsPerLine) == 0 )
1935 aRet.append(
"\n" );
1945 if( xClass.is() && xClass->getTypeClass() == TypeClass_SEQUENCE )
1950 +
" " + pVar->
GetName() +
" ( " );
1954 sal_uInt32 nParamCount = aParamsSeq.getLength();
1957 if( nParamCount > 0 )
1959 for( sal_uInt32 j = 0; j < nParamCount; j++ )
1962 if( j < nParamCount - 1 )
1963 aRet.append(
", " );
1967 aRet.append(
"void" );
1969 aRet.append(
" ) " );
1971 if(
i == nMethodCount - 1 )
1972 aRet.append(
"\n" );
1974 aRet.append(
"; " );
1977 return aRet.makeStringAndClear();
1998 if( pHint->
GetId() == SfxHintId::BasicDataWanted )
2001 sal_Int32
nId = pProp->
nId;
2011 else if(
nId == -2 )
2019 else if(
nId == -3 )
2059 Any aRetAny = xPropSet->getPropertyValue( pProp->
GetName() );
2076 sal_uInt32 nParamCount = pParams ? (pParams->
Count() - 1) : 0;
2079 if ( bCanBeConsideredAMethod && nParamCount )
2091 if( pParams && bCanBeConsideredAMethod )
2101 else if( pHint->
GetId() == SfxHintId::BasicDataChanged )
2105 if( pProp->
aUnoProp.Attributes & PropertyAttribute::READONLY )
2130 xPropSet->setPropertyValue( pProp->
GetName(), aAnyValue );
2159 if( pHint->
GetId() == SfxHintId::BasicDataWanted )
2162 sal_uInt32 nParamCount = pParams ? (pParams->
Count() - 1) : 0;
2164 bool bOutParams =
false;
2170 const ParamInfo* pParamInfos = rInfoSeq.getConstArray();
2171 sal_uInt32 nUnoParamCount = rInfoSeq.getLength();
2172 sal_uInt32 nAllocParamCount = nParamCount;
2175 if( nParamCount > nUnoParamCount )
2177 nParamCount = nUnoParamCount;
2178 nAllocParamCount = nParamCount;
2180 else if( nParamCount < nUnoParamCount )
2186 bool bError =
false;
2187 for( sal_uInt32
i = nParamCount ;
i < nUnoParamCount ;
i++ )
2189 const ParamInfo& rInfo = pParamInfos[
i];
2191 if( rxClass->getTypeClass() != TypeClass_ANY )
2198 nAllocParamCount = nUnoParamCount;
2202 if( nAllocParamCount > 0 )
2204 args.realloc( nAllocParamCount );
2205 Any* pAnyArgs =
args.getArray();
2206 for( sal_uInt32
i = 0 ;
i < nParamCount ;
i++ )
2208 const ParamInfo& rInfo = pParamInfos[
i];
2211 css::uno::Type aType( rxClass->getTypeClass(), rxClass->getName() );
2219 ParamMode aParamMode = rInfo.aMode;
2220 if( aParamMode != ParamMode_IN )
2245 const Any* pAnyArgs =
args.getConstArray();
2249 const ParamInfo* pParamInfos = rInfoSeq.getConstArray();
2252 for( j = 0 ; j < nParamCount ; j++ )
2254 const ParamInfo& rInfo = pParamInfos[j];
2255 ParamMode aParamMode = rInfo.aMode;
2256 if( aParamMode != ParamMode_IN )
2286 , bNeedIntrospection( true )
2287 , bNativeCOMObject( false )
2294 TypeClass
eType = aUnoObj_.getValueType().getTypeClass();
2296 if(
eType == TypeClass_INTERFACE )
2315 if( !xTypeProvider.is() )
2324 if( xAutomationObject.is() )
2332 bool bFatalError =
true;
2335 bool bSetClassName =
false;
2336 OUString aClassName_;
2337 if(
eType == TypeClass_STRUCT ||
eType == TypeClass_EXCEPTION )
2340 bFatalError =
false;
2343 if( aName_.isEmpty() )
2345 aClassName_ = aUnoObj_.getValueType().getTypeName();
2346 bSetClassName =
true;
2351 else if(
eType == TypeClass_INTERFACE )
2354 bFatalError =
false;
2393 catch (
const css::uno::DeploymentException& )
2438 if ( pModBasic == pBasic )
2448 else if( pMeth->
pPrev )
2453 pMeth->
pPrev =
nullptr;
2454 pMeth->
pNext =
nullptr;
2456 pMeth->SbxValue::Clear();
2463 pMeth = pMeth->
pNext;
2466 pMeth = pMeth->
pNext;
2475 pMeth->SbxValue::Clear();
2476 pMeth = pMeth->
pNext;
2483 const OUString& aName_,
2489 , mbInvocation( bInvocation )
2521 pInfo =
new SbxInfo();
2524 const ParamInfo* pParamInfos = rInfoSeq.getConstArray();
2525 sal_uInt32 nParamCount = rInfoSeq.getLength();
2527 for( sal_uInt32
i = 0 ;
i < nParamCount ;
i++ )
2529 const ParamInfo& rInfo = pParamInfos[
i];
2530 OUString aParamName = rInfo.aName;
2553 const OUString& aName_,
2562 , aUnoProp(
std::move( aUnoProp_ ))
2564 , mbInvocation( bInvocation )
2565 , mRealType( eRealSbxType )
2566 , mbUnoStruct( bUnoStruct )
2592 OUString aUName( rName );
2597 OUString aUExactName =
mxExactName->getExactName( aUName );
2598 if( !aUExactName.isEmpty() )
2600 aUName = aUExactName;
2603 if(
mxUnoAccess->hasProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ) )
2606 getProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS );
2610 if( rProp.Attributes & PropertyAttribute::MAYBEVOID )
2615 SbxDataType eRealSbxType = ( ( rProp.Attributes & PropertyAttribute::MAYBEVOID ) ?
unoToSbxType( rProp.Type.getTypeClass() ) : eSbxType );
2617 auto pProp = tools::make_ref<SbUnoProperty>( rProp.Name, eSbxType, eRealSbxType, rProp, 0,
false, ( rProp.Type.getTypeClass() == css::uno::TypeClass_STRUCT ) );
2622 MethodConcept::ALL - MethodConcept::DANGEROUS ) )
2626 getMethod( aUName, MethodConcept::ALL - MethodConcept::DANGEROUS );
2629 auto xMethRef = tools::make_ref<SbUnoMethod>( rxMethod->getName(),
2630 unoToSbxType( rxMethod->getReturnType() ), rxMethod,
false );
2632 pRes = xMethRef.get();
2642 if( xNameAccess.is() && xNameAccess->hasByName( rName ) )
2644 Any aAny = xNameAccess->getByName( rName );
2657 catch(
const NoSuchElementException& e )
2676 if( !aUExactName.isEmpty() )
2678 aUName = aUExactName;
2687 auto xVarRef = tools::make_ref<SbUnoProperty>( aUName,
SbxVARIANT,
SbxVARIANT, aDummyProp, 0,
true,
false );
2689 pRes = xVarRef.get();
2694 auto xMethRef = tools::make_ref<SbUnoMethod>( aUName,
SbxVARIANT, xDummyMethod,
true );
2696 pRes = xMethRef.get();
2701 if ( xDirectInvoke.is() && xDirectInvoke->hasMember( aUName ) )
2703 auto xMethRef = tools::make_ref<SbUnoMethod>( aUName,
SbxVARIANT, xDummyMethod,
true );
2705 pRes = xMethRef.get();
2761 pMethods = tools::make_ref<SbxArray>();
2762 pProps = tools::make_ref<SbxArray>();
2780 sal_uInt32 nPropCount =
props.getLength();
2784 for(
i = 0 ;
i < nPropCount ;
i++ )
2790 if( rProp.Attributes & PropertyAttribute::MAYBEVOID )
2795 SbxDataType eRealSbxType = ( ( rProp.Attributes & PropertyAttribute::MAYBEVOID ) ?
unoToSbxType( rProp.Type.getTypeClass() ) : eSbxType );
2797 auto xVarRef = tools::make_ref<SbUnoProperty>( rProp.Name, eSbxType, eRealSbxType, rProp,
i,
false, ( rProp.Type.getTypeClass() == css::uno::TypeClass_STRUCT ) );
2806 ( MethodConcept::ALL - MethodConcept::DANGEROUS );
2807 sal_uInt32 nMethCount = aMethodSeq.getLength();
2809 for(
i = 0 ;
i < nMethCount ;
i++ )
2815 auto xMethRef = tools::make_ref<SbUnoMethod>
2816 ( rxMethod->getName(),
unoToSbxType( rxMethod->getReturnType() ), rxMethod,
false );
2848 if( xHarryName.is() && xHarryName->hasByHierarchicalName( aClassName ) )
2854 TypeClass
eType = xClass->getTypeClass();
2855 if ( (
eType != TypeClass_STRUCT ) && (
eType != TypeClass_EXCEPTION ) )
2860 xClass->createObject( aNewAny );
2899 else if ( pUnoStructObj )
2909 if (rPar.
Count() < 2)
2926 refVar->PutObject( xUnoObj.
get() );
2932 if (rPar.
Count() < 2)
2946 xInterface =
xFactory->createInstance( aServiceName );
2954 if( xInterface.is() )
2958 if( xUnoObj->getUnoAny().hasValue() )
2961 refVar->PutObject( xUnoObj.
get() );
2965 refVar->PutObject(
nullptr );
2970 refVar->PutObject(
nullptr );
2977 if (rPar.
Count() < 3)
2988 aArgAsAny >>= aArgs;
2995 xInterface =
xFactory->createInstanceWithArguments( aServiceName, aArgs );
3003 if( xInterface.is() )
3007 if( xUnoObj->getUnoAny().hasValue() )
3010 refVar->PutObject( xUnoObj.
get() );
3014 refVar->PutObject(
nullptr );
3019 refVar->PutObject(
nullptr );
3032 refVar->PutObject( xUnoObj.
get() );
3038 sal_uInt32 nParCount = rPar.
Count();
3047 refVar->PutBool(
false );
3052 if( obj ==
nullptr )
3056 Any aAny = obj->getUnoAny();
3057 auto x = o3tl::tryAccess<Reference<XInterface>>(aAny);
3069 for( sal_uInt32
i = 2 ;
i < nParCount ;
i++ )
3081 OUString aClassName = xClass->getName();
3082 Type aClassType( xClass->getTypeClass(), aClassName );
3083 if( !(*x)->queryInterface( aClassType ).hasValue() )
3090 refVar->PutBool(
true );
3096 if (rPar.
Count() < 2)
3104 refVar->PutBool(
false );
3108 if( !xParam->IsObject() )
3114 if( obj ==
nullptr )
3118 Any aAny = obj->getUnoAny();
3119 TypeClass
eType = aAny.getValueType().getTypeClass();
3120 if(
eType == TypeClass_STRUCT )
3122 refVar->PutBool(
true );
3129 if (rPar.
Count() < 3)
3137 refVar->PutBool(
false );
3141 if( !xParam1->IsObject() )
3147 if( obj1 ==
nullptr )
3151 Any aAny1 = obj1->getUnoAny();
3152 TypeClass eType1 = aAny1.getValueType().getTypeClass();
3153 if( eType1 != TypeClass_INTERFACE )
3161 if( !xParam2->IsObject() )
3167 if( obj2 ==
nullptr )
3171 Any aAny2 = obj2->getUnoAny();
3172 TypeClass eType2 = aAny2.getValueType().getTypeClass();
3173 if( eType2 != TypeClass_INTERFACE )
3182 refVar->PutBool(
true );
3194 TypeDescriptionSearchDepth depth )
3198 if ( xTypeEnumAccess.is() )
3202 xEnum = xTypeEnumAccess->createTypeDescriptionEnumeration(
3203 sSearchRoot, types, depth );
3205 catch(
const NoSuchTypeNameException& ) {}
3206 catch(
const InvalidTypeNameException& ) {}
3229 while ( xEnum->hasMoreElements() )
3232 if ( xConstants.is() )
3235 OUString sFullName = xConstants->getName();
3236 sal_Int32 indexLastDot = sFullName.lastIndexOf(
'.');
3237 OUString sLeafName( sFullName );
3238 if ( indexLastDot > -1 )
3240 sLeafName = sFullName.copy( indexLastDot + 1);
3244 for (
const auto& ctd : aConsts)
3247 sFullName = ctd->getName();
3248 indexLastDot = sFullName.lastIndexOf(
'.');
3249 sLeafName = sFullName;
3250 if ( indexLastDot > -1 )
3252 sLeafName = sFullName.copy( indexLastDot + 1);
3254 aConstHash[ sLeafName.toAsciiLowerCase() ] = ctd->getConstantValue();
3265 bool bConstant =
false;
3284 auto it =
aConstHash.find( rName.toAsciiLowerCase() );
3304 if( xTypeAccess->hasByHierarchicalName( rName ) )
3306 Any aRet = xTypeAccess->getByHierarchicalName( rName );
3310 if( xTypeDesc.is() )
3312 TypeClass eTypeClass = xTypeDesc->getTypeClass();
3313 if( eTypeClass == TypeClass_MODULE || eTypeClass == TypeClass_CONSTANTS )
3338 Any aAny = xField->get( {} );
3364 if( xHarryName.is() )
3368 Any aValue = xHarryName->getByHierarchicalName( aNewName );
3369 TypeClass
eType = aValue.getValueType().getTypeClass();
3372 if(
eType == TypeClass_INTERFACE )
3388 catch(
const NoSuchElementException& )
3453 if( xTypeAccess->hasByHierarchicalName( rName ) )
3455 Any aRet = xTypeAccess->getByHierarchicalName( rName );
3459 if( xTypeDesc.is() )
3461 TypeClass eTypeClass = xTypeDesc->getTypeClass();
3462 if( eTypeClass == TypeClass_SERVICE )
3465 if( xServiceTypeDesc.is() )
3466 pSbUnoService =
new SbUnoService( rName, xServiceTypeDesc );
3470 return pSbUnoService;
3486 int nCtorCount = aSCDSeq.getLength();
3487 for(
int i = 0 ;
i < nCtorCount ; ++
i )
3491 OUString
aName( xCtor->getName() );
3492 if(
aName.isEmpty() )
3494 if( xCtor->isDefaultConstructor() )
3500 if( !
aName.isEmpty() )
3523 if( pUnoCtor && pHint->
GetId() == SfxHintId::BasicDataWanted )
3526 sal_uInt32 nParamCount = pParams ? (pParams->
Count() - 1) : 0;
3532 sal_uInt32 nUnoParamCount = aParameterSeq.getLength();
3535 bool bParameterError =
false;
3538 bool bRestParameterMode =
false;
3539 if( nUnoParamCount > 0 )
3542 if( xLastParam.is() )
3544 if( xLastParam->isRestParameter() )
3545 bRestParameterMode =
true;
3550 sal_uInt32 nSbxParameterOffset = 1;
3551 sal_uInt32 nParameterOffsetByContext = 0;
3553 if( nParamCount > nUnoParamCount )
3558 if( (aArg0 >>= xFirstParamContext) && xFirstParamContext.is() )
3559 nParameterOffsetByContext = 1;
3562 sal_uInt32 nEffectiveParamCount = nParamCount - nParameterOffsetByContext;
3563 sal_uInt32 nAllocParamCount = nEffectiveParamCount;
3564 if( nEffectiveParamCount > nUnoParamCount )
3566 if( !bRestParameterMode )
3568 nEffectiveParamCount = nUnoParamCount;
3569 nAllocParamCount = nUnoParamCount;
3573 else if( nUnoParamCount > nEffectiveParamCount )
3576 int nDiff = nUnoParamCount - nEffectiveParamCount;
3577 if( !bRestParameterMode || nDiff > 1 )
3579 bParameterError =
true;
3584 if( !bParameterError )
3586 bool bOutParams =
false;
3587 if( nAllocParamCount > 0 )
3589 args.realloc( nAllocParamCount );
3590 Any* pAnyArgs =
args.getArray();
3591 for( sal_uInt32
i = 0 ;
i < nEffectiveParamCount ;
i++ )
3593 sal_uInt32 iSbx =
i + nSbxParameterOffset + nParameterOffsetByContext;
3597 if(
i < nUnoParamCount )
3599 xParam = pParameterSeq[
i];
3604 if( !xParamTypeDesc.is() )
3606 css::uno::Type aType( xParamTypeDesc->getTypeClass(), xParamTypeDesc->getName() );
3612 if( !bOutParams && xParam->isOut() )
3624 xFirstParamContext.is()
3625 ? xFirstParamContext
3630 OUString aServiceName =
GetName();
3634 xRet = xServiceMgr->createInstanceWithArgumentsAndContext( aServiceName,
args, xContext );
3646 const Any* pAnyArgs =
args.getConstArray();
3648 for( sal_uInt32 j = 0 ; j < nUnoParamCount ; j++ )
3654 if( xParam->isOut() )
3667 , m_xServiceCtorDesc( xServiceCtorDesc )
3686 if( xTypeAccess->hasByHierarchicalName( rName ) )
3688 Any aRet = xTypeAccess->getByHierarchicalName( rName );
3692 if( xTypeDesc.is() )
3694 TypeClass eTypeClass = xTypeDesc->getTypeClass();
3695 if( eTypeClass == TypeClass_SINGLETON )
3698 if( xSingletonTypeDesc.is() )
3703 return pSbUnoSingleton;
3720 sal_uInt32 nParamCount = pParams ? (pParams->
Count() - 1) : 0;
3721 sal_uInt32 nAllowedParamCount = 1;
3724 if( nParamCount > 0 )
3729 if( (aArg1 >>= xFirstParamContext) && xFirstParamContext.is() )
3730 xContextToUse = xFirstParamContext;
3733 if( !xContextToUse.is() )
3736 --nAllowedParamCount;
3739 if( nParamCount > nAllowedParamCount )
3746 if( xContextToUse.is() )
3748 OUString aSingletonName =
"/singletons/"
3751 xContextToUse->getValueByName( aSingletonName ) >>= xRet;
3766class BasicAllListener_Impl :
public WeakImplHelper< XAllListener >
3768 void firing_impl(
const AllEventObject& Event, Any* pRet);
3772 OUString aPrefixName;
3774 explicit BasicAllListener_Impl( OUString aPrefixName );
3777 virtual void SAL_CALL firing(
const AllEventObject& Event)
override;
3778 virtual Any SAL_CALL approveFiring(
const AllEventObject& Event)
override;
3781 virtual void SAL_CALL disposing(
const EventObject& Source)
override;
3786BasicAllListener_Impl::BasicAllListener_Impl(OUString aPrefixName_)
3787 : aPrefixName(
std::move( aPrefixName_ ))
3791void BasicAllListener_Impl::firing_impl(
const AllEventObject& Event, Any* pRet )
3798 OUString aMethodName = aPrefixName + Event.MethodName;
3809 const Any * pArgs = Event.Arguments.getConstArray();
3810 sal_Int32
nCount = Event.Arguments.getLength();
3811 for( sal_Int32 i = 0;
i <
nCount;
i++ )
3816 xSbxArray->Put(xVar.
get(), i + 1);
3819 pLib->Call( aMethodName, xSbxArray.
get() );
3841void BasicAllListener_Impl::firing(
const AllEventObject& Event )
3843 firing_impl( Event,
nullptr );
3846Any BasicAllListener_Impl::approveFiring(
const AllEventObject& Event )
3849 firing_impl( Event, &aRetAny );
3855void BasicAllListener_Impl ::disposing(
const EventObject& )
3868class InvocationToAllListenerMapper :
public WeakImplHelper< XInvocation >
3877 virtual void SAL_CALL
setValue(
const OUString& PropertyName,
const Any& Value)
override;
3878 virtual Any SAL_CALL
getValue(
const OUString& PropertyName)
override;
3879 virtual sal_Bool SAL_CALL hasMethod(
const OUString& Name)
override;
3900 if( xInvocationAdapterFactory.is() && xListenerType.is() && xListener.is() )
3903 new InvocationToAllListenerMapper(xListenerType, xListener, Helper);
3904 Type aListenerType( xListenerType->getTypeClass(), xListenerType->getName() );
3905 xAdapter = xInvocationAdapterFactory->createAdapter( xInvocationToAllListenerMapper, {aListenerType} );
3912InvocationToAllListenerMapper::InvocationToAllListenerMapper
3927Any SAL_CALL InvocationToAllListenerMapper::invoke(
const OUString& FunctionName,
const Sequence< Any >& Params,
3934 bool bApproveFiring =
false;
3939 if( ( xReturnType.is() && xReturnType->getTypeClass() != TypeClass_VOID ) ||
3940 aExceptionSeq.hasElements() )
3942 bApproveFiring =
true;
3947 sal_uInt32 nParamCount = aParamSeq.getLength();
3948 if( nParamCount > 1 )
3950 const ParamInfo* pInfo = aParamSeq.getConstArray();
3951 for( sal_uInt32 i = 0 ;
i < nParamCount ;
i++ )
3953 if( pInfo[ i ].aMode != ParamMode_IN )
3955 bApproveFiring =
true;
3962 AllEventObject aAllEvent;
3963 aAllEvent.Source = getXWeak();
3966 aAllEvent.MethodName = FunctionName;
3967 aAllEvent.Arguments = Params;
3968 if( bApproveFiring )
3976void SAL_CALL InvocationToAllListenerMapper::setValue(
const OUString&,
const Any&)
3980Any SAL_CALL InvocationToAllListenerMapper::getValue(
const OUString&)
3986sal_Bool SAL_CALL InvocationToAllListenerMapper::hasMethod(
const OUString& Name)
3993sal_Bool SAL_CALL InvocationToAllListenerMapper::hasProperty(
const OUString& Name)
4006 if (rPar.
Count() != 3)
4031 InvocationAdapterFactory::create( xContext );
4039 OUString aClassName = xClass->getName();
4040 Type aClassType( xClass->getTypeClass(), aClassName );
4041 aTmp = xLst->queryInterface( aClassType );
4042 if( !aTmp.hasValue() )
4046 xAllLst->xSbxObj = pUnoObj;
4047 xAllLst->xSbxObj->SetParent( pBasic );
4051 xBasicUnoListeners->Insert(pUnoObj, xBasicUnoListeners->Count());
4055 refVar->PutObject( xAllLst->xSbxObj.get() );
4068 refVar->PutObject( xUnoObj.
get() );
4077 if (rPar.
Count() != 3)
4087 if( aTypeName ==
"type" )
4089 SbxDataType eBaseType = pVal->SbxValue::GetType();
4090 OUString aValTypeName;
4103 Any aUnoAny = obj->getUnoAny();
4104 aUnoAny >>= xIdlClass;
4107 if( xIdlClass.is() )
4109 aValTypeName = xIdlClass->getName();
4116 Any aTypeAny( aType );
4119 refVar->PutObject( xUnoAnyObject.
get() );
4129 aRet = xTypeAccess->getByHierarchicalName( aTypeName );
4131 catch(
const NoSuchElementException& e1 )
4139 TypeClass eTypeClass = xTypeDesc->getTypeClass();
4140 Type aDestType( eTypeClass, aTypeName );
4149 refVar->PutObject( xUnoAnyObject.
get() );
4154class ModuleInvocationProxy :
public WeakImplHelper< XInvocation, XComponent >
4159 bool m_bProxyIsClassModuleObject;
4164 ModuleInvocationProxy( std::u16string_view aPrefix,
SbxObjectRef const & xScopeObj );
4168 virtual void SAL_CALL
setValue(
const OUString& rProperty,
const Any& rValue )
override;
4169 virtual Any SAL_CALL
getValue(
const OUString& rProperty )
override;
4170 virtual sal_Bool SAL_CALL hasMethod(
const OUString& rName )
override;
4173 virtual Any SAL_CALL
invoke(
const OUString& rFunction,
4179 virtual void SAL_CALL
dispose()
override;
4186ModuleInvocationProxy::ModuleInvocationProxy( std::u16string_view aPrefix,
SbxObjectRef const & xScopeObj )
4187 : m_aPrefix( OUString::
Concat(aPrefix) +
"_" )
4188 , m_xScopeObj( xScopeObj )
4190 m_bProxyIsClassModuleObject = xScopeObj.
is() &&
dynamic_cast<const SbClassModuleObject*
>( xScopeObj.
get() ) !=
nullptr;
4198void SAL_CALL ModuleInvocationProxy::setValue(
const OUString& rProperty,
const Any& rValue)
4200 if( !m_bProxyIsClassModuleObject )
4201 throw UnknownPropertyException();
4205 OUString aPropertyFunctionName =
"Property Set "
4211 if( pMeth ==
nullptr )
4215 throw UnknownPropertyException(aPropertyFunctionName);
4222 xArray->Put(xVar.
get(), 1);
4235Any SAL_CALL ModuleInvocationProxy::getValue(
const OUString& rProperty)
4237 if( !m_bProxyIsClassModuleObject )
4239 throw UnknownPropertyException();
4243 OUString aPropertyFunctionName =
"Property Get "
4249 if( pMeth ==
nullptr )
4253 throw UnknownPropertyException(aPropertyFunctionName);
4263sal_Bool SAL_CALL ModuleInvocationProxy::hasMethod(
const OUString& )
4268sal_Bool SAL_CALL ModuleInvocationProxy::hasProperty(
const OUString& )
4273Any SAL_CALL ModuleInvocationProxy::invoke(
const OUString& rFunction,
4282 if( !xScopeObj.
is() )
4286 OUString aFunctionName = m_aPrefix
4289 bool bOldReschedule =
false;
4294 if ( bOldReschedule )
4300 if( pMeth ==
nullptr )
4309 sal_Int32 nParamCount = rParams.getLength();
4313 const Any *pArgs = rParams.getConstArray();
4314 for( sal_Int32 i = 0 ;
i < nParamCount ;
i++ )
4318 xArray->Put(xVar.
get(), sal::static_int_cast<sal_uInt16>(i + 1));
4338void SAL_CALL ModuleInvocationProxy::dispose()
4340 std::unique_lock aGuard( m_aMutex );
4342 EventObject
aEvent(
static_cast<XComponent*
>(
this) );
4345 m_xScopeObj =
nullptr;
4350 std::unique_lock aGuard( m_aMutex );
4356 std::unique_lock aGuard( m_aMutex );
4362 std::u16string_view aPrefix,
4377 xRet = xServiceMgr->createInstanceWithArgumentsAndContext(
4378 "com.sun.star.custom.UnoComListener",
4393struct StarBasicDisposeItem
4399 explicit StarBasicDisposeItem(
StarBASIC* pBasic )
4400 : m_pBasic( pBasic )
4401 , m_pRegisteredVariables(
new SbxArray())
4415 [&pBasic](StarBasicDisposeItem*
pItem) { return pItem->m_pBasic == pBasic; });
4422 if(
pItem ==
nullptr )
4424 pItem =
new StarBasicDisposeItem( pBasic );
4434 pItem->m_vComImplementsObjects.emplace_back(xComponent );
4441 pArray->
Put(pVar, pArray->
Count());
4450 StarBasicDisposeItem*
pItem = *it;
4454 for( sal_uInt32
i = 0 ;
i <
nCount ; ++
i )
4461 for (
auto const& elem : rv)
4464 if (xComponent.is())
4465 xComponent->dispose();
4484 xServiceMgr->createInstanceWithContext(
"com.sun.star.custom.ComImplementsFactory", xContext ),
4487 if( !xComImplementsFactory.is() )
4490 bool bSuccess =
false;
4494 for( sal_uInt32
i = 0 ;
i <
nCount ; ++
i )
4497 const OUString& aIfaceName = pVar->
GetName();
4499 if( !aIfaceName.isEmpty() )
4501 OUString aPureIfaceName = aIfaceName;
4502 sal_Int32 indexLastDot = aIfaceName.lastIndexOf(
'.');
4503 if ( indexLastDot > -1 )
4505 aPureIfaceName = aIfaceName.copy( indexLastDot + 1 );
4514 xRet = xComImplementsFactory->createInstanceWithArguments(
args );
4525 if( xComponent.is() )
4532 pParentBasic =
dynamic_cast<StarBASIC*
>( pObjParent );
4533 pCurObject = pObjParent;
4535 while( pParentBasic ==
nullptr && pCurObject !=
nullptr );
4537 assert( pParentBasic !=
nullptr );
4556 bool bSuccess =
false;
4558 if(
auto pUnoObj =
dynamic_cast<SbUnoObject*
>( pObj) )
4580 &aRet,
reinterpret_cast< uno_ReleaseFunc
>(cpp_release) );
4582 maType.getDescription(&pTD);
4585 reinterpret_cast< uno_AcquireFunc
>(cpp_acquire) );
4594 const_cast<void*
>(rValue.getValue()),
4595 rValue.getValueTypeRef(),
4596 reinterpret_cast< uno_QueryInterfaceFunc
>(cpp_queryInterface),
4597 reinterpret_cast< uno_AcquireFunc
>(cpp_acquire),
4598 reinterpret_cast< uno_ReleaseFunc
>(cpp_release) );
4599 OSL_ENSURE(bSuccess,
4600 "StructRefInfo::setValue: ooops... the value could not be assigned!");
4605 return maType.getTypeName();
4610 return const_cast<char *
>(
static_cast<char const *
>(
maAny.getValue()) +
mnPos);
4615 return maType.getTypeClass();
4633 for ( typelib_CompoundTypeDescription * pCompTypeDescr =
reinterpret_cast<typelib_CompoundTypeDescription *
>(pTD);
4635 pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription )
4637 typelib_TypeDescriptionReference ** ppTypeRefs = pCompTypeDescr->ppTypeRefs;
4638 rtl_uString ** ppNames = pCompTypeDescr->ppMemberNames;
4639 sal_Int32 * pMemberOffsets = pCompTypeDescr->pMemberOffsets;
4640 for ( sal_Int32
nPos = pCompTypeDescr->nMembers;
nPos--; )
4657 StructFieldInfo::iterator it =
maFields.find( rName );
4665 aProp.Type = css::uno::Type( it->second->getTypeClass(), it->second->getTypeName() );
4666 const bool bIsStruct = aProp.Type.getTypeClass() == css::uno::TypeClass_STRUCT;
4670 pRes = xVarRef.
get();
4720 const OUString& rName = field.first;
4722 eSbxType =
unoToSbxType( field.second->getTypeClass() );
4726 aProp.Type = css::uno::Type( field.second->getTypeClass(), field.second->getTypeName() );
4727 const bool bIsStruct = aProp.Type.getTypeClass() == css::uno::TypeClass_STRUCT;
4747 sal_uInt32 nPropCount =
pProps->Count();
4748 sal_uInt32 nPropsPerLine = 1 + nPropCount / 30;
4749 for( sal_uInt32
i = 0;
i < nPropCount;
i++ )
4754 OUStringBuffer aPropStr;
4755 if( (
i % nPropsPerLine) == 0 )
4757 aPropStr.append(
"\n" );
4781 if(
i == nPropCount - 1 )
4783 aPropStr.append(
"\n" );
4787 aPropStr.append(
"; " );
4789 aRet.append( aPropStr );
4792 return aRet.makeStringAndClear();
4809 if( pHint->
GetId() == SfxHintId::BasicDataWanted )
4812 sal_Int32
nId = pProp->
nId;
4819 +
" not available.\n(TypeClass is not TypeClass_INTERFACE)\n";
4824 else if(
nId == -2 )
4832 else if(
nId == -3 )
4836 OUString aRet =
"Methods of object "
4838 +
"\nNo methods found\n";
4846 Any aRetAny = it->second->getValue();
4852 else if( pHint->
GetId() == SfxHintId::BasicDataChanged )
4858 it->second->setValue( aAnyValue );
4874 StructFieldInfo::iterator it =
maFields.find( rMemberName );
4876 css::uno::Type aFoundType;
4877 sal_Int32 nFoundPos = -1;
4881 aFoundType = it->second->getType();
4882 nFoundPos = it->second->getPos();
4891 if(
aName.isEmpty() )
4895 OUStringBuffer aRet;
4896 if(
aName.getLength() > 20 )
4898 aRet.append(
"\n" );
4900 aRet.append(
"\"" +
aName +
"\":" );
4901 return aRet.makeStringAndClear();
void SAL_CALL uno_any_construct(uno_Any *pDest, void *pSource, typelib_TypeDescription *pTypeDescr, uno_AcquireFunc acquire) SAL_THROW_EXTERN_C()
void SAL_CALL uno_any_destruct(uno_Any *pValue, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
css::uno::Sequence< OUString > & getNames()
ErrCode Call(SbxValue *pRet, SbxVariable *pCaller=nullptr)
bool createCOMWrapperForIface(css::uno::Any &o_rRetAny, SbClassModuleObject *pProxyClassModuleObject)
std::unique_ptr< SbClassData > pClassData
SbUnoClass(const OUString &aName_)
virtual SbxVariable * Find(const OUString &, SbxClassType) override
const css::uno::Reference< css::reflection::XIdlClass > m_xClass
virtual SbxObjectRef CreateObject(const OUString &) override
virtual SbxBaseRef Create(sal_uInt16 nSbxId, sal_uInt32) override
css::uno::Reference< css::reflection::XIdlMethod > m_xUnoMethod
virtual ~SbUnoMethod() override
std::unique_ptr< css::uno::Sequence< css::reflection::ParamInfo > > pParamInfoSeq
bool isInvocationBased() const
const css::uno::Sequence< css::reflection::ParamInfo > & getParamInfos()
SbUnoMethod(const OUString &aName_, SbxDataType eSbxType, css::uno::Reference< css::reflection::XIdlMethod > const &xUnoMethod_, bool bInvocation)
virtual SbxInfo * GetInfo() override
css::uno::Reference< css::beans::XMaterialHolder > mxMaterialHolder
css::uno::Reference< css::beans::XIntrospectionAccess > mxUnoAccess
SbUnoObject(const OUString &aName_, const css::uno::Any &aUnoObj_)
bool isNativeCOMObject() const
css::uno::Any getUnoAny()
const css::uno::Reference< css::script::XInvocation > & getInvocation() const
virtual ~SbUnoObject() override
static bool getDefaultPropName(SbUnoObject const *pUnoObj, OUString &sDfltProp)
void Notify(SfxBroadcaster &, const SfxHint &rHint) override
void implCreateDbgProperties()
css::uno::Reference< css::script::XInvocation > mxInvocation
css::uno::Any maTmpUnoObj
const css::uno::Reference< css::beans::XIntrospectionAccess > & getIntrospectionAccess() const
std::shared_ptr< SbUnoStructRefObject > maStructInfo
virtual SbxVariable * Find(const OUString &, SbxClassType) override
css::uno::Reference< css::beans::XExactName > mxExactName
css::uno::Reference< css::beans::XExactName > mxExactNameInvocation
void createAllProperties()
SbUnoProperty(const SbUnoProperty &)=delete
css::beans::Property aUnoProp
virtual ~SbUnoProperty() override
bool isInvocationBased() const
virtual SbxInfo * GetInfo() override
const css::uno::Reference< css::reflection::XServiceConstructorDescription > & getServiceCtorDesc() const
SbUnoServiceCtor(const OUString &aName_, css::uno::Reference< css::reflection::XServiceConstructorDescription > const &xServiceCtorDesc)
virtual ~SbUnoServiceCtor() override
const css::uno::Reference< css::reflection::XServiceTypeDescription2 > m_xServiceTypeDesc
virtual SbxVariable * Find(const OUString &, SbxClassType) override
void Notify(SfxBroadcaster &, const SfxHint &rHint) override
SbUnoSingleton(const OUString &aName_)
void Notify(SfxBroadcaster &, const SfxHint &rHint) override
OUString Impl_DumpProperties()
virtual ~SbUnoStructRefObject() override
void implCreateDbgProperties()
OUString getDbgObjectName() const
SbUnoStructRefObject(const OUString &aName_, StructRefInfo aMemberInfo)
void createAllProperties()
virtual SbxVariable * Find(const OUString &, SbxClassType) override
void Notify(SfxBroadcaster &, const SfxHint &rHint) override
css::uno::Any getUnoAny()
StructRefInfo maMemberInfo
StructRefInfo getStructMember(const OUString &rMember)
bool IsReschedule() const
bool IsCompatibility() const
void EnableReschedule(bool bEnable)
static bool isVBAEnabled()
SbxVariable * Get(sal_uInt32)
void Put(SbxVariable *, sal_uInt32)
void SetFlags(SbxFlagBits n)
void SetFlag(SbxFlagBits n)
SbxFlagBits GetFlags() const
void ResetFlag(SbxFlagBits n)
SbxVariable * Get(SbxArray *)
void unoAddDim(sal_Int32, sal_Int32)
void Put(SbxVariable *, const sal_Int32 *)
SbxVariable * GetVar() const
SbxArray * GetProperties()
virtual SbxVariable * Find(const OUString &, SbxClassType)
const OUString & GetClassName() const
void SetClassName(const OUString &rNew)
void Remove(const OUString &, SbxClassType)
void QuickInsert(SbxVariable *)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
void SetDfltProperty(const OUString &r)
sal_Unicode GetChar() const
sal_uInt32 GetULong() const
OUString GetOUString() const
bool PutString(const OUString &)
SbxBase * GetObject() const
void fillAutomationDecimal(css::bridge::oleautomation::Decimal &rAutomationDec) const
SbxDataType GetFullType() const
bool PutULong(sal_uInt32)
sal_uInt64 GetUInt64() const
bool PutCurrency(sal_Int64)
void PutDecimal(css::bridge::oleautomation::Decimal const &rAutomationDec)
sal_uInt8 GetByte() const
bool PutInteger(sal_Int16)
bool PutObject(SbxBase *)
sal_Int64 GetInt64() const
sal_Int32 GetLong() const
sal_Int16 GetInteger() const
bool PutUShort(sal_uInt16)
sal_uInt16 GetUShort() const
bool PutChar(sal_Unicode)
bool PutUInt64(sal_uInt64)
bool Put(const SbxValues &)
const SbxObject * GetParent() const
SfxBroadcaster & GetBroadcaster()
void SetName(const OUString &)
void SetParameters(SbxArray *p)
virtual SbxDataType GetType() const override
SbxArray * GetParameters() const
const OUString & GetName(SbxNameType=SbxNameType::NONE) const
bool IsBroadcaster() const
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
SbxArrayRef const & getUnoListeners()
static ErrCode GetSfxFromVBError(sal_uInt16 nError)
static void Error(ErrCode, const OUString &rMsg={})
static void FatalError(ErrCode)
const css::uno::Type & getType() const
css::uno::TypeClass getTypeClass() const
void setValue(const css::uno::Any &)
css::uno::Any & getRootAnyRef()
OUString getTypeName() const
std::vector< OUString > aConstCache
SbxVariable * getVBAConstant(const OUString &rName)
static VBAConstantHelper & instance()
bool isVBAConstantType(std::u16string_view rName)
std::unordered_map< OUString, css::uno::Any > aConstHash
css::uno::Type const & get()
sal_Bool SAL_CALL uno_type_assignData(void *pDest, typelib_TypeDescriptionReference *pDestType, void *pSource, typelib_TypeDescriptionReference *pSourceType, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
std::vector< Reference< css::datatransfer::clipboard::XClipboardListener > > m_aListeners
EmbeddedObjectRef * pObject
Reference< XIdlClass > m_xListenerType
Reference< XAllListener > m_xAllListener
Reference< XTypeConverter > xConverter
Reference< XMultiServiceFactory > xSMgr
Reference< XSingleServiceFactory > xFactory
Reference< XIntrospection > xIntrospection
Reference< XIdlReflection > xCoreReflection
Reference< XTypeConverter > xTypeConverter
struct _typelib_TypeDescription typelib_TypeDescription
bool hasProperty(const OUString &_rName, const Reference< XPropertySet > &_rxSet)
Reference< XMultiServiceFactory > getProcessServiceFactory()
Reference< XComponentContext > getProcessComponentContext()
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
bool enum2int(sal_Int32 &rnEnum, const css::uno::Any &rAny)
css::uno::Any int2enum(sal_Int32 nEnum, const css::uno::Type &rType)
css::beans::Optional< css::uno::Any > getValue(std::u16string_view id)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
SVX_DLLPUBLIC OUString getProperty(css::uno::Reference< css::beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rName)
def invoke(object, methodname, argTuple)
Reference< XInvocation2 > xInvocation
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
#define ERRCODE_BASIC_EXCEPTION
#define ERRCODE_BASIC_INVALID_OBJECT
#define ERRCODE_BASIC_PROP_READONLY
#define ERRCODE_BASIC_OUT_OF_RANGE
#define ERRCODE_BASIC_MATH_OVERFLOW
#define ERRCODE_BASIC_BAD_ARGUMENT
#define ERRCODE_BASIC_PROPERTY_NOT_FOUND
#define ERRCODE_BASIC_NOT_OPTIONAL
SbUnoObject * createOLEObject_Impl(const OUString &aType)
static OUString Dbg_SbxDataType2String(SbxDataType eType)
void registerComponentToBeDisposedForBasic(const Reference< XComponent > &xComponent, StarBASIC *pBasic)
void clearNativeObjectWrapperVector()
static void implHandleAnyException(const Any &_rCaughtException)
static OUString Impl_DumpMethods(SbUnoObject &rUnoObj)
static DisposeItemVector GaDisposeItemVector
static void implAppendExceptionMsg(OUStringBuffer &_inout_rBuffer, const Exception &_e, std::u16string_view _rExceptionType, sal_Int32 _nLevel)
static StarBasicDisposeItem * lcl_getOrCreateItemForBasic(StarBASIC *pBasic)
void RTL_Impl_CreateUnoServiceWithArguments(SbxArray &rPar)
SbUnoClass * findUnoClass(const OUString &rName)
static void processAutomationParams(SbxArray *pParams, Sequence< Any > &args, sal_uInt32 nParamCount)
static Any convertAny(const Any &rVal, const Type &aDestType)
std::vector< StarBasicDisposeItem * > DisposeItemVector
void clearUnoMethodsForBasic(StarBASIC const *pBasic)
static SbxObject * lcl_getNativeObject(sal_uInt32 nIndex)
static OUString Impl_GetInterfaceInfo(const Reference< XInterface > &x, const Reference< XIdlClass > &xClass, sal_uInt16 nRekLevel)
static Any implRekMultiDimArrayToSequence(SbxDimArray *pArray, const Type &aElemType, sal_Int32 nMaxDimIndex, sal_Int32 nActualDim, sal_Int32 *pActualIndices, sal_Int32 *pLowerBounds, sal_Int32 *pUpperBounds)
static OUString implGetExceptionMsg(const Exception &e, std::u16string_view aExceptionType_)
static OUString Impl_GetSupportedInterfaces(SbUnoObject &rUnoObj)
void RTL_Impl_HasInterfaces(SbxArray &rPar)
static SbUnoMethod * pFirst
void SbRtl_CreateUnoListener(StarBASIC *pBasic, SbxArray &rPar, bool)
static OUString Impl_DumpProperties(SbUnoObject &rUnoObj)
void RTL_Impl_CreateUnoValue(SbxArray &rPar)
static void implHandleBasicErrorException(BasicErrorException const &e)
void SetSbUnoObjectDfltPropName(SbxObject *pObj)
static SbUnoObjectRef Impl_CreateUnoStruct(const OUString &aClassName)
static Reference< XIdlReflection > getCoreReflection_Impl()
static OUString getDbgObjectNameImpl(SbUnoObject &rUnoObj)
static bool implGetTypeByName(const OUString &rName, Type &rRetType)
static Reference< XTypeDescriptionEnumeration > getTypeDescriptorEnumeration(const OUString &sSearchRoot, const Sequence< TypeClass > &types, TypeDescriptionSearchDepth depth)
void RTL_Impl_GetDefaultContext(SbxArray &rPar)
SbUnoService * findUnoService(const OUString &rName)
void registerComListenerVariableForBasic(SbxVariable *pVar, StarBASIC *pBasic)
void RTL_Impl_EqualUnoObjects(SbxArray &rPar)
bool handleToStringForCOMObjects(SbxObject *pObj, SbxValue *pVal)
static Reference< XHierarchicalNameAccess > const & getTypeProvider_Impl()
constexpr OUStringLiteral ID_DBG_PROPERTIES
static Any sbxToUnoValueImpl(const SbxValue *pVar, bool bBlockConversionToSmallestType=false)
void RTL_Impl_CreateUnoStruct(SbxArray &rPar)
void unoToSbxValue(SbxVariable *pVar, const Any &aValue)
static sal_uInt32 lcl_registerNativeObjectWrapper(SbxObject *pNativeObj)
std::vector< WeakReference< XComponent > > ComponentRefVector
static DisposeItemVector::iterator lcl_findItemForBasic(StarBASIC const *pBasic)
char const aSeqLevelStr[]
SbUnoSingleton * findUnoSingleton(const OUString &rName)
SbxVariable * getDefaultProp(SbxVariable *pRef)
static Type getUnoTypeForSbxBaseType(SbxDataType eType)
static OUString getDbgObjectName(SbUnoObject &rUnoObj)
SbxObjectRef GetSbUnoObject(const OUString &aName, const Any &aUnoObj_)
static void implSequenceToMultiDimArray(SbxDimArray *&pArray, Sequence< sal_Int32 > &indices, Sequence< sal_Int32 > &sizes, const Any &aValue, sal_Int32 dimension, bool bIsZeroIndex, Type const *pType)
Reference< XInterface > createComListener(const Any &aControlAny, const OUString &aVBAType, std::u16string_view aPrefix, const SbxObjectRef &xScopeObj)
static Type getUnoTypeForSbxValue(const SbxValue *pVal)
static Any invokeAutomationMethod(const OUString &Name, Sequence< Any > const &args, SbxArray *pParams, sal_uInt32 nParamCount, Reference< XInvocation > const &rxInvocation, INVOKETYPE invokeType)
static SbxDataType unoToSbxType(TypeClass eType)
void disposeComVariablesForBasic(StarBASIC const *pBasic)
static void implHandleWrappedTargetException(const Any &_rWrappedTargetException)
constexpr OUStringLiteral ID_DBG_METHODS
static Reference< XHierarchicalNameAccess > const & getCoreReflection_HierarchicalNameAccess_Impl()
bool checkUnoObjectType(SbUnoObject &rUnoObj, const OUString &rClass)
void createAllObjectProperties(SbxObject *pObj)
Any sbxToUnoValue(const SbxValue *pVar)
void RTL_Impl_CreateUnoService(SbxArray &rPar)
constexpr OUStringLiteral ID_DBG_SUPPORTEDINTERFACES
static Reference< XInterface > createAllListenerAdapter(const Reference< XInvocationAdapterFactory2 > &xInvocationAdapterFactory, const Reference< XIdlClass > &xListenerType, const Reference< XAllListener > &xListener, const Any &Helper)
OUString getBasicObjectTypeName(SbxObject *pObj)
static Reference< XTypeConverter > const & getTypeConverter_Impl()
std::vector< ObjectItem > NativeObjectWrapperVector
void RTL_Impl_GetProcessServiceManager(SbxArray &rPar)
static Reference< XIdlClass > TypeToIdlClass(const Type &rType)
void RTL_Impl_IsUnoStruct(SbxArray &rPar)
constexpr sal_uInt16 SbxMAXUINT
void SAL_CALL typelib_typedescription_release(typelib_TypeDescription *pTD) SAL_THROW_EXTERN_C()
void SAL_CALL typelib_typedescription_getByName(typelib_TypeDescription **ppRet, rtl_uString *pName) SAL_THROW_EXTERN_C()