diff options
Diffstat (limited to 'svtools/source/svhtml/parhtml.cxx')
-rw-r--r-- | svtools/source/svhtml/parhtml.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 5d94f12a4040..2cf6ebbc3c2b 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -1632,10 +1632,14 @@ int HTMLParser::FilterPRE( int nToken ) case HTML_TABCHAR: { - xub_StrLen nSpaces = sal::static_int_cast< xub_StrLen >( - 8 - (nPre_LinePos % 8)); + sal_Int32 nSpaces = (8 - (nPre_LinePos % 8)); DBG_ASSERT( !aToken.Len(), "Why is the token not empty?" ); - aToken.Expand( nSpaces, ' ' ); + if (aToken.Len() < nSpaces) + { + using comphelper::string::padToLength; + OUStringBuffer aBuf(aToken); + aToken = padToLength(aBuf, nSpaces, ' ').makeStringAndClear(); + } nPre_LinePos += nSpaces; nToken = HTML_TEXTTOKEN; } |