sw/source/ui/index/cnttab.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0a86d2e2dd898aa1d455c0bbde91dd9a8b011daf
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 09:23:57 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>

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 );

Reply via email to