sw/source/ui/index/cnttab.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 87ef871a777b1d44486ae51e536c95a0b5c49e67 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Mon Mar 25 13:59:06 2024 +0100 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Tue Apr 2 03:38:02 2024 +0200 Related tdf#160351: the field name can be shorter than two symbols Change-Id: Ieb6b78b3f9802e66de642a9e708b11c55c0d9a11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165285 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> (cherry picked from commit 02609da5ee8188cb00fc0b97052d2cc8d2576900) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165249 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit b94108edce1ea90044dba46156ab935410cd71ca) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165312 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 61aeb63080d1..3435e59820b8 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3126,7 +3126,7 @@ void SwTokenWindow::InsertAtSelection(const SwFormToken& rToken) //use the first two chars as symbol OUString sTmp(SwAuthorityFieldType::GetAuthFieldName( static_cast<ToxAuthorityField>(aToInsertToken.nAuthorityField))); - pButton->SetText(sTmp.copy(0, 2)); + pButton->SetText(sTmp.copy(0, std::min(sTmp.getLength(), sal_Int32(2)))); } pButton->Check();