diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/source/embindmaker/embindmaker.cxx | 4 | ||||
-rw-r--r-- | static/source/unoembindhelpers/PrimaryBindings.cxx | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/static/source/embindmaker/embindmaker.cxx b/static/source/embindmaker/embindmaker.cxx index f0f14b7e31aa..4241d10b1575 100644 --- a/static/source/embindmaker/embindmaker.cxx +++ b/static/source/embindmaker/embindmaker.cxx @@ -975,7 +975,9 @@ SAL_IMPLEMENT_MAIN() } dumpAttributes(cppOut, mgr, ifc, ifcEnt, {}); dumpMethods(cppOut, mgr, ifc, ifcEnt, {}); - cppOut << " ;\n"; + cppOut << " ;\n" + " ::unoembindhelpers::registerUnoType<::com::sun::star::uno::Reference<" + << cppName(ifc) << ">>();\n"; dumpRegisterFunctionEpilog(cppOut, n); for (auto const& attr : ifcEnt->getDirectAttributes()) { diff --git a/static/source/unoembindhelpers/PrimaryBindings.cxx b/static/source/unoembindhelpers/PrimaryBindings.cxx index 2e5ecac00054..985ebacc52b2 100644 --- a/static/source/unoembindhelpers/PrimaryBindings.cxx +++ b/static/source/unoembindhelpers/PrimaryBindings.cxx @@ -334,7 +334,15 @@ EMSCRIPTEN_BINDINGS(PrimaryBindings) _emval_take_value(getTypeId(self.getValueType()), argv)); } case css::uno::TypeClass_INTERFACE: - return emscripten::val::undefined(); //TODO + { + auto const ifc = *static_cast<css::uno::XInterface* const*>(self.getValue()); + auto const copy = std::malloc(sizeof(css::uno::XInterface*)); + *static_cast<css::uno::XInterface**>(copy) = ifc; + ifc->acquire(); + emscripten::internal::WireTypePack argv(std::move(copy)); + return emscripten::val::take_ownership( + _emval_take_value(getTypeId(self.getValueType()), argv)); + } default: O3TL_UNREACHABLE; }; |