summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/README.wasm.md14
-rw-r--r--static/source/embindmaker/embindmaker.cxx13
2 files changed, 12 insertions, 15 deletions
diff --git a/static/README.wasm.md b/static/README.wasm.md
index 19da4518030c..5397e2124d16 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -228,11 +228,11 @@ Some usage examples through javascript of the current implementation:
let uno = init_unoembind_uno(Module);
let css = uno.com.sun.star;
xModel = Module.getCurrentModelFromViewSh();
-xTextDocument = new css.text.XTextDocument(xModel);
+xTextDocument = css.text.XTextDocument.query(xModel);
xText = xTextDocument.getText();
-xSimpleText = new css.text.XSimpleText(xText);
+xSimpleText = css.text.XSimpleText.query(xText);
xTextCursor = xSimpleText.createTextCursor();
-xTextRange = new css.text.XTextRange(xTextCursor);
+xTextRange = css.text.XTextRange.query(xTextCursor);
xTextRange.setString("string here!");
xModel.delete(); xTextDocument.delete(); xText.delete(); xSimpleText.delete(); xTextCursor.delete(); xTextRange.delete();
```
@@ -242,13 +242,13 @@ xModel.delete(); xTextDocument.delete(); xText.delete(); xSimpleText.delete(); x
let uno = init_unoembind_uno(Module);
let css = uno.com.sun.star;
xModel = Module.getCurrentModelFromViewSh();
-xEnumAccess = new css.container.XEnumerationAccess(xText);
+xEnumAccess = css.container.XEnumerationAccess.query(xText);
xParaEnumeration = xEnumAccess.createEnumeration();
while (xParaEnumeration.hasMoreElements()) {
- xParagraph = new css.text.XTextRange(xParaEnumeration.nextElement().get());
- if (xParagraph.$is()) {
- xParaProps = new css.beans.XPropertySet(xParagraph);
+ xParagraph = css.text.XTextRange.query(xParaEnumeration.nextElement().get());
+ if (xParagraph !== null) {
+ xParaProps = css.beans.XPropertySet.query(xParagraph);
let color = new Module.uno_Any(
Module.uno_Type.Long(), Math.floor(Math.random() * 0xFFFFFF));
xParaProps.setPropertyValue("CharColor", color);
diff --git a/static/source/embindmaker/embindmaker.cxx b/static/source/embindmaker/embindmaker.cxx
index 252d7b25451c..abce7e574f67 100644
--- a/static/source/embindmaker/embindmaker.cxx
+++ b/static/source/embindmaker/embindmaker.cxx
@@ -1082,18 +1082,15 @@ SAL_IMPLEMENT_MAIN()
" .smart_ptr<::com::sun::star::uno::Reference<"
<< cppName(ifc) << ">>(\"uno_Reference_" << jsName(ifc)
<< "\")\n"
+ " .class_function(\"query\", "
+ "+[](::com::sun::star::uno::Reference<::com::sun::star::uno::XInterface> "
+ "const & the_object) { return ::com::sun::star::uno::Reference<"
+ << cppName(ifc)
+ << ">(the_object, ::com::sun::star::uno::UNO_QUERY); })\n"
" .class_function(\"reference\", +[]("
<< cppName(ifc)
<< " * the_interface) { return ::com::sun::star::uno::Reference(the_interface); "
"}, ::emscripten::allow_raw_pointers())\n"
- " "
- ".constructor(+[](::com::sun::star::uno::Reference<::com::sun::star::uno::"
- "XInterface> const & the_object) { return ::com::sun::star::uno::Reference<"
- << cppName(ifc)
- << ">(the_object, ::com::sun::star::uno::UNO_QUERY); })\n"
- " .function(\"$is\", +[](::com::sun::star::uno::Reference<"
- << cppName(ifc)
- << "> const & the_self) { return the_self.is(); })\n"
" .function(\"$equals\", +[](::com::sun::star::uno::Reference<"
<< cppName(ifc)
<< "> const & the_self, "