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

New commits:
commit 81fdf964bec1c4555db2f08c300c7b3f09130fbc
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Mon Mar 25 13:59:06 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Mar 26 14:17:35 2024 +0100

    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 <serval2...@yahoo.fr>
    (cherry picked from commit 02609da5ee8188cb00fc0b97052d2cc8d2576900)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165249
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

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

Reply via email to