diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-21 13:42:28 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-21 12:15:36 +0200 |
commit | 02c0e5f970dee4d064fcb26b378cbfe6f3a1bc05 (patch) | |
tree | f5f01173f9b2e3fdc96d77bfaf0ce4a75a275475 /winaccessibility/source/UAccCOM/AccTable.cxx | |
parent | 02e2870c86a00380549266f944c9218187a002ec (diff) |
Simplify BSTR construction from OUString a bit
Use the known string length into account (and I definitely like to
not rely on the undocumented implementation detail that OUString is
null-terminated).
Change-Id: I0e7478d25e802f8f8e31f02cf8d77613c1325bc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172170
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'winaccessibility/source/UAccCOM/AccTable.cxx')
-rw-r--r-- | winaccessibility/source/UAccCOM/AccTable.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx b/winaccessibility/source/UAccCOM/AccTable.cxx index bf0cc9563515..b142b525bb32 100644 --- a/winaccessibility/source/UAccCOM/AccTable.cxx +++ b/winaccessibility/source/UAccCOM/AccTable.cxx @@ -27,6 +27,7 @@ #include <sal/log.hxx> #include <vcl/svapp.hxx> #include <o3tl/char16_t2wchar_t.hxx> +#include <systools/win32/oleauto.hxx> #include <com/sun/star/accessibility/XAccessible.hpp> #include "MAccessible.h" @@ -125,7 +126,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_columnDescription(long column, const OUString& ouStr = pRXTable->getAccessibleColumnDescription(column); SysFreeString(*description); - *description = SysAllocString(o3tl::toW(ouStr.getStr())); + *description = sal::systools::BStr::newBSTR(ouStr); if (*description==nullptr) return E_FAIL; return S_OK; @@ -323,7 +324,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTable::get_rowDescription(long row, BSTR * const OUString& ouStr = pRXTable->getAccessibleRowDescription(row); SysFreeString(*description); - *description = SysAllocString(o3tl::toW(ouStr.getStr())); + *description = sal::systools::BStr::newBSTR(ouStr); if (*description==nullptr) return E_FAIL; return S_OK; |