diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-29 11:22:25 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-29 11:43:50 +0100 |
commit | cbba41823a2e67add2620e4901bf0ead542c2932 (patch) | |
tree | 921e608e0b72f88d0acfe48b7953bb4c37205799 /svtools/source/svhtml | |
parent | 2fa8271155450894ed1716a6cce97540950518b0 (diff) |
String::Expand -> string::padToLength
Change-Id: I684e371c31ba76d2e9b563eed70449764346161b
Diffstat (limited to 'svtools/source/svhtml')
-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; } |