summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-11 09:56:11 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-11 13:36:11 +0100
commitc35985a4b42d6a7d654b4fd1f99a966b75ee28a6 (patch)
tree8b72ce44b2f71a0ed91559a2d8f7fed2919db116 /static
parent36a169c10f0457c30a0d327fda585c4decb33532 (diff)
Embind construction of UNO Any enum
Change-Id: I1b2167e261f1020b228f8ca2618c7f0009ca1d3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164646 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'static')
-rw-r--r--static/source/unoembindhelpers/PrimaryBindings.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/static/source/unoembindhelpers/PrimaryBindings.cxx b/static/source/unoembindhelpers/PrimaryBindings.cxx
index 8fb5ad39a6da..0aadc85f6086 100644
--- a/static/source/unoembindhelpers/PrimaryBindings.cxx
+++ b/static/source/unoembindhelpers/PrimaryBindings.cxx
@@ -17,6 +17,7 @@
#include <com/sun/star/uno/Type.hxx>
#include <comphelper/processfactory.hxx>
#include <o3tl/any.hxx>
+#include <o3tl/temporary.hxx>
#include <o3tl/unreachable.hxx>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
@@ -283,7 +284,16 @@ EMSCRIPTEN_BINDINGS(PrimaryBindings)
case TypeClass_SEQUENCE:
return {}; //TODO
case TypeClass_ENUM:
- return {}; //TODO
+ {
+ 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(
+ &o3tl::temporary(
+ emscripten::internal::fromGenericWireType<sal_Int32>(result)),
+ rUnoType);
+ }
case TypeClass_STRUCT:
return {}; //TODO
case TypeClass_EXCEPTION: