sw/source/ui/index/cnttab.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 4fd5e282a6b0b9e531740b500c52040dc6ac5481 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Mar 25 17:41:24 2024 +0500 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Mar 26 13:14:31 2024 +0100 tdf#160351: the field name can be shorter than two symbols Change-Id: Id834ae2919661752b921510f766c9e9ff7fc16fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165282 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit 4a14bad7232ecf23d23c1997dc20922d0b4892cb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165246 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 0a4569912915459b3eb10d0d52624403ce15c46f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165248 diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index f68aa514d272..61aeb63080d1 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2919,7 +2919,7 @@ SwTOXWidget* SwTokenWindow::InsertItem(const OUString& rText, const SwFormToken& //use the first two chars as symbol OUString sTmp(SwAuthorityFieldType::GetAuthFieldName( static_cast<ToxAuthorityField>(rToken.nAuthorityField))); - pButton->SetText(sTmp.copy(0, 2)); + pButton->SetText(sTmp.copy(0, std::min(sTmp.getLength(), sal_Int32(2)))); } sal_uInt32 nIndex = GetControlIndex( rToken.eTokenType );