summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-11 10:13:18 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-11 13:36:24 +0100
commit2995a0e0785911322c9d57e98b925073ff6cb6bd (patch)
tree690086aef3407f0cdbd976c9b36c05ab0a62b7db /static
parentc35985a4b42d6a7d654b4fd1f99a966b75ee28a6 (diff)
Embind construction of UNO Any sequence/struct/exception/interface
Change-Id: I43d924126f4d34e0efbcea61dd5f4bd9be235426 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164650 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'static')
-rw-r--r--static/source/unoembindhelpers/PrimaryBindings.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/static/source/unoembindhelpers/PrimaryBindings.cxx b/static/source/unoembindhelpers/PrimaryBindings.cxx
index 0aadc85f6086..c8d4717aa347 100644
--- a/static/source/unoembindhelpers/PrimaryBindings.cxx
+++ b/static/source/unoembindhelpers/PrimaryBindings.cxx
@@ -282,7 +282,17 @@ EMSCRIPTEN_BINDINGS(PrimaryBindings)
case TypeClass_TYPE:
return css::uno::Any(rObject.as<css::uno::Type>());
case TypeClass_SEQUENCE:
- return {}; //TODO
+ case TypeClass_STRUCT:
+ case TypeClass_EXCEPTION:
+ case TypeClass_INTERFACE:
+ {
+ emscripten::internal::EM_DESTRUCTORS destructors = nullptr;
+ emscripten::internal::EM_GENERIC_WIRE_TYPE result
+ = _emval_as(rObject.as_handle(), getTypeId(rUnoType), &destructors);
+ emscripten::internal::DestructorsRunner dr(destructors);
+ return css::uno::Any(
+ emscripten::internal::fromGenericWireType<void const*>(result), rUnoType);
+ }
case TypeClass_ENUM:
{
emscripten::internal::EM_DESTRUCTORS destructors = nullptr;
@@ -294,12 +304,6 @@ EMSCRIPTEN_BINDINGS(PrimaryBindings)
emscripten::internal::fromGenericWireType<sal_Int32>(result)),
rUnoType);
}
- case TypeClass_STRUCT:
- return {}; //TODO
- case TypeClass_EXCEPTION:
- return {}; //TODO
- case TypeClass_INTERFACE:
- return {}; //TODO
default:
throw std::invalid_argument("bad type class");
}