summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2024-03-25 13:59:06 +0100
committerJulien Nabet <serval2412@yahoo.fr>2024-03-25 22:43:20 +0100
commit02609da5ee8188cb00fc0b97052d2cc8d2576900 (patch)
tree2b3b04754aaaee5a09f5ab1497af5cd860f6b121 /sw/source
parent0581190bc4e5502d93aa695365e7bf82b23d1ecf (diff)
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 <serval2412@yahoo.fr>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/ui/index/cnttab.cxx2
1 files changed, 1 insertions, 1 deletions
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();