From 9c0788f545a9276d18060965794143179917e766 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 8 Apr 2015 20:34:35 +0100 Subject: fix assert on exporting fdo79938-1.ott to .doc Change-Id: I93f331bd1c57bd016948e3ed784530724a1028b4 --- sw/source/filter/ww8/ww8atr.cxx | 6 ++++-- 1 file 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(5, aIt->sText.getLength()); + rText = aIt->sText.copy(0, nCount); // #i21237# break; - + } case TOKEN_LINK_START: case TOKEN_LINK_END: break; -- cgit