summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 8810fb934890..4ebf690645b7 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2026,10 +2026,12 @@ static int lcl_CheckForm( const SwForm& rForm, sal_uInt8 nLvl, OUString& rText )
nRet = 2;
break;
case TOKEN_TEXT:
+ {
nRet = 3;
- rText = aIt->sText.copy( 0, 5 ); // #i21237#
+ sal_Int32 nCount = std::min<sal_Int32>(5, aIt->sText.getLength());
+ rText = aIt->sText.copy(0, nCount); // #i21237#
break;
-
+ }
case TOKEN_LINK_START:
case TOKEN_LINK_END:
break;