sw/source/ui/index/cnttab.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 02609da5ee8188cb00fc0b97052d2cc8d2576900 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Mon Mar 25 13:59:06 2024 +0100 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Mon Mar 25 22:43:20 2024 +0100 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> diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index f07cf8ab2883..535dc298dd5a 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3140,7 +3140,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();