static/source/embindmaker/embindmaker.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 9f236a078cd179835b8c651990e3afecee6170ca
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Tue Jan 30 21:10:59 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Jan 30 23:57:16 2024 +0100

    Pass the_self by const ref in Embind wrapper functions
    
    Change-Id: Ie8bfec2a9fdd5f126fd2879d2ba06f1fa5c1019e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162781
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/static/source/embindmaker/embindmaker.cxx 
b/static/source/embindmaker/embindmaker.cxx
index c7aba58c3089..262e202313a8 100644
--- a/static/source/embindmaker/embindmaker.cxx
+++ b/static/source/embindmaker/embindmaker.cxx
@@ -473,8 +473,9 @@ void dumpWrapper(std::ostream& out, 
rtl::Reference<TypeManager> const& manager,
                  OUString const& interfaceName, 
unoidl::InterfaceTypeEntity::Method const& method,
                  std::list<OUString> const& baseTrail)
 {
-    out << "        .function(\"" << method.name << "\", +[](" << 
cppName(interfaceName);
-    out << " * the_self";
+    out << "        .function(\"" << method.name << "\", 
+[](::com::sun::star::uno::Reference<"
+        << cppName(interfaceName);
+    out << "> const & the_self";
     if (!method.parameters.empty())
     {
         out << ", ";
@@ -486,6 +487,10 @@ void dumpWrapper(std::ostream& out, 
rtl::Reference<TypeManager> const& manager,
         out << "static_cast<" << cppName(base) << " *>(";
     }
     out << "the_self";
+    if (!baseTrail.empty())
+    {
+        out << ".get()";
+    }
     for (std::size_t i = 0; i != baseTrail.size(); ++i)
     {
         out << ")";

Reply via email to