From cbba41823a2e67add2620e4901bf0ead542c2932 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Aug 2012 11:22:25 +0100 Subject: String::Expand -> string::padToLength Change-Id: I684e371c31ba76d2e9b563eed70449764346161b --- svtools/source/svhtml/parhtml.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'svtools/source/svhtml') 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; } -- cgit