diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-25 17:41:24 +0500 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-03-26 09:23:57 +0100 |
commit | 0a86d2e2dd898aa1d455c0bbde91dd9a8b011daf (patch) | |
tree | 04553ebc14b4b83777fd837bfae809f063e7aabf | |
parent | 999d14c0e4dc8063d7afd5a6c216b1842ef5a171 (diff) |
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 <serval2412@yahoo.fr>
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 4a14bad7232ecf23d23c1997dc20922d0b4892cb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165246
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index a5d3bf92ddef..f07cf8ab2883 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2933,7 +2933,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 ); |