diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-25 17:41:24 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-25 16:52:31 +0100 |
commit | 4a14bad7232ecf23d23c1997dc20922d0b4892cb (patch) | |
tree | 653c8652966dcd6a029d2b9efa03f80b09d529ff /sw | |
parent | 9a0b37a5337faee5634cc9fce4955da204b95bf4 (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>
Diffstat (limited to 'sw')
-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 ); |