summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-08 17:50:57 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-08 22:45:11 +0100
commit80bb8c666f09264b0df7181d03ebad3b883de797 (patch)
tree279e198bb87e93f2910ce1324fc682a0e53e920f /static
parentad7963f939c629657c1aca03765169ace14a5bbd (diff)
Redesign Embind UNO Any construction
...taking a full UNO Type instead of just a UNO Type class (so that it will be able to construct Any containing sequence, enum, struct, exception, and interface, in later steps); moving the Type argument first (as that looks more natural), and renaming from Any to uno_Any (in line with the other uno_Type, uno_Sequence_..., etc.) Change-Id: I154681c4b9187f5f5d037d503652fe7bcd41adcd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164593 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'static')
-rw-r--r--static/README.wasm.md3
-rw-r--r--static/source/unoembindhelpers/PrimaryBindings.cxx6
2 files changed, 5 insertions, 4 deletions
diff --git a/static/README.wasm.md b/static/README.wasm.md
index ef8a02f8261a..1abfd39de6c8 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -248,7 +248,8 @@ while (xParaEnumeration.hasMoreElements()) {
xParagraph = new css.text.XTextRange(xParaEnumeration.nextElement(), Module.uno_Reference.FromAny);
if (xParagraph.$is()) {
xParaProps = new css.beans.XPropertySet(xParagraph.$query());
- let color = new Module.Any(Math.floor(Math.random() * 0xFFFFFF), css.uno.TypeClass.LONG);
+ let color = new Module.uno_Any(
+ Module.uno_Type.Long(), Math.floor(Math.random() * 0xFFFFFF));
xParaProps.setPropertyValue("CharColor", color);
color.delete();
}
diff --git a/static/source/unoembindhelpers/PrimaryBindings.cxx b/static/source/unoembindhelpers/PrimaryBindings.cxx
index bfbf7d90b12d..a250e31aa144 100644
--- a/static/source/unoembindhelpers/PrimaryBindings.cxx
+++ b/static/source/unoembindhelpers/PrimaryBindings.cxx
@@ -248,9 +248,9 @@ EMSCRIPTEN_BINDINGS(PrimaryBindings)
});
// Any
- class_<Any>("Any")
- .constructor(+[](const val& rObject, const TypeClass& rUnoType) -> Any {
- switch (rUnoType)
+ class_<Any>("uno_Any")
+ .constructor(+[](const css::uno::Type& rUnoType, const val& rObject) -> Any {
+ switch (rUnoType.getTypeClass())
{
case TypeClass_VOID:
return {};