From 02609da5ee8188cb00fc0b97052d2cc8d2576900 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 25 Mar 2024 13:59:06 +0100 Subject: 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 --- sw/source/ui/index/cnttab.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/source') 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(aToInsertToken.nAuthorityField))); - pButton->SetText(sTmp.copy(0, 2)); + pButton->SetText(sTmp.copy(0, std::min(sTmp.getLength(), sal_Int32(2)))); } pButton->Check(); -- cgit