summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-06-25 10:05:52 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-06-25 17:16:40 +0200
commit5caba6ebf48e1ffe3f281055ae2aff5234bd594e (patch)
tree62b286cc3fe3b54002c0ae03de3e3d7dd5db686a /extensions
parent5da5cb2b5e1adc955b236dfa97fadff09f03490b (diff)
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@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/ole/oleobjw.cxx7
1 files changed, 5 insertions, 2 deletions
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;