[Libreoffice-commits] core.git: extensions/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 25 15:17:22 UTC 2021


 extensions/source/ole/oleobjw.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5caba6ebf48e1ffe3f281055ae2aff5234bd594e
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Jun 25 10:05:52 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Jun 25 17:16:40 2021 +0200

    Add back computation of excepinfo.bstrDescription length
    
    ...which had been dropped with eebd84b337506c8fff151493f9b51bd127dbc89f
    "loplugin:stringview (clang-cl)".  But as discussed in the comments at
    <https://gerrit.libreoffice.org/c/core/+/116548/2/extensions/source/ole/oleobjw.cxx#b1432>
    "loplugin:stringview (clang-cl)", that dropped support for embedded NULs ("not
    that this should matter here", though).
    
    Change-Id: Ifdb327cbe8b20b365c8174802622f83b4510d547
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117836
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx
index b9123a031ee8..0cc08f94d535 100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -26,6 +26,7 @@
 #include <osl/thread.h>
 
 #include <memory>
+#include <string_view>
 #include <com/sun/star/script/CannotConvertException.hpp>
 #include <com/sun/star/script/FailReason.hpp>
 #include <com/sun/star/beans/XMaterialHolder.hpp>
@@ -1428,7 +1429,8 @@ uno::Any SAL_CALL IUnknownWrapper::directInvoke( const OUString& aName, const un
                 break;
             case DISP_E_EXCEPTION:
                     message = OUString::Concat("[automation bridge]: ")
-                        + o3tl::toU(excepinfo.bstrDescription);
+                        + std::u16string_view(o3tl::toU(excepinfo.bstrDescription),
+                            ::SysStringLen(excepinfo.bstrDescription));
                     throw InvocationTargetException(message, Reference<XInterface>(), Any());
                     break;
             case DISP_E_MEMBERNOTFOUND:
@@ -2049,7 +2051,8 @@ Any  IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
             break;
         case DISP_E_EXCEPTION:
                 message = OUString::Concat("[automation bridge]: ")
-                    + o3tl::toU(excepinfo.bstrDescription);
+                    + std::u16string_view(o3tl::toU(excepinfo.bstrDescription),
+                                    ::SysStringLen(excepinfo.bstrDescription));
 
                 throw InvocationTargetException(message, Reference<XInterface>(), Any());
             break;


More information about the Libreoffice-commits mailing list