diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-02-07 14:47:54 +0100 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-02-08 09:30:22 +0100 |
commit | 72056edca078dd010368de15d03321a60c6d5cdd (patch) | |
tree | cf95055fa1cd91da12d868feaff8afce94733265 /static | |
parent | 578d9be50413a4bdc809f8b5f58cc177458f8325 (diff) |
Embind: Allow UNO sequences to be constructed from JS arrays
...though
> let seq = new Module.uno_Sequence_string(["foo", "bar", "baz"]);
> // ...
> delete seq;
is still ugly.
And Embind only allows for overload resolution by number of parameters, not by
their type, so using the original sequence constructor had to be changed to
> let seq = new Module.uno_Sequence_string(3, Module.uno_Sequence.FromSize);
> seq.set(0, "foo");
> seq.set(1, "bar");
> seq.set(2, "baz");
> // ...
> delete seq;
Change-Id: If26ff4a485ba16b65cf24b6fe729d379c733c473
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163097
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'static')
-rw-r--r-- | static/source/unoembindhelpers/PrimaryBindings.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/static/source/unoembindhelpers/PrimaryBindings.cxx b/static/source/unoembindhelpers/PrimaryBindings.cxx index fe3b6e29908f..ee4998988c19 100644 --- a/static/source/unoembindhelpers/PrimaryBindings.cxx +++ b/static/source/unoembindhelpers/PrimaryBindings.cxx @@ -46,9 +46,10 @@ Reference<css::frame::XModel> getCurrentModelFromViewSh() EMSCRIPTEN_BINDINGS(PrimaryBindings) { - // Reference bits enum_<unoembindhelpers::uno_Reference>("uno_Reference") .value("FromAny", unoembindhelpers::uno_Reference::FromAny); + enum_<unoembindhelpers::uno_Sequence>("uno_Sequence") + .value("FromSize", unoembindhelpers::uno_Sequence::FromSize); // Any class_<Any>("Any").constructor(+[](const val& rObject, const TypeClass& rUnoType) -> Any { |