vcl/source/gdi/CommonSalLayout.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 986892ddee74dd666dd467962a2effb21df96cb5 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed May 11 20:13:09 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu May 12 11:39:48 2022 +0200 we already know the length of the string we pass to hb_language_from_string Change-Id: I860ed7c253ef872ed6609a01030294609cbbb78e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134209 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 0de505f7820e..7e2bcd6290cb 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -447,12 +447,12 @@ bool GenericSalLayout::LayoutText(vcl::text::ImplLayoutArgs& rArgs, const SalLay hb_buffer_set_script(pHbBuffer, aSubRun.maScript); if (!msLanguage.isEmpty()) { - hb_buffer_set_language(pHbBuffer, hb_language_from_string(msLanguage.getStr(), -1)); + hb_buffer_set_language(pHbBuffer, hb_language_from_string(msLanguage.getStr(), msLanguage.getLength())); } else { OString sLanguage = OUStringToOString(rArgs.maLanguageTag.getBcp47(), RTL_TEXTENCODING_ASCII_US); - hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), -1)); + hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), sLanguage.getLength())); } hb_buffer_set_flags(pHbBuffer, static_cast<hb_buffer_flags_t>(nHbFlags)); hb_buffer_add_utf16(