extensions/source/ole/oleobjw.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 1090506502d07a42b2aa9a98c037c9a492263830 Author: Mike Kaganski <[email protected]> AuthorDate: Sat Jan 25 18:50:42 2025 +0500 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Jan 27 09:36:50 2025 +0100 tdf#160770: use OUString ctor that takes length, which allows nullptr bstrDescription can obviously be nullptr. Change-Id: I09f368a632143479c165cb0653a33aef26fe0e95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180743 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 1c763a6b88c2efd425e764778fc8c709387cf2ff) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180764 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index d9c0296110fd..e3e5c23357f5 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -430,6 +430,8 @@ void SAL_CALL IUnknownWrapper::setValue( const OUString& aPropertyName, } } +static OUString BStrToOUString(BSTR s) { return OUString(o3tl::toU(s), SysStringLen(s)); } + Any SAL_CALL IUnknownWrapper::getValue( const OUString& aPropertyName ) { if ( ! m_spDispatch ) @@ -539,13 +541,13 @@ Any SAL_CALL IUnknownWrapper::getValue( const OUString& aPropertyName ) case DISP_E_BADPARAMCOUNT: case DISP_E_BADVARTYPE: case DISP_E_EXCEPTION: - throw RuntimeException(OUString(o3tl::toU(excepinfo.bstrDescription))); + throw RuntimeException(BStrToOUString(excepinfo.bstrDescription)); break; case DISP_E_MEMBERNOTFOUND: - throw UnknownPropertyException(OUString(o3tl::toU(excepinfo.bstrDescription))); + throw UnknownPropertyException(BStrToOUString(excepinfo.bstrDescription)); break; default: - throw RuntimeException(OUString(o3tl::toU(excepinfo.bstrDescription))); + throw RuntimeException(BStrToOUString(excepinfo.bstrDescription)); break; } }
