summaryrefslogtreecommitdiffstats
path: root/sw/source/ui/index/cnttab.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/index/cnttab.cxx')
-rw-r--r--sw/source/ui/index/cnttab.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index a5d3bf92dd..535dc298dd 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 );
@@ -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();