Kaydet (Commit) 9e1dfe40 authored tarafından Matteo Casalin's avatar Matteo Casalin

Index returned by getToken is always lower than string length

Also take care of handling possibly empty strings, for which
the initial 0 index would fail the comparison.

Change-Id: I280fac697554f2a4513a641ac258b1d2baf803f4
Reviewed-on: https://gerrit.libreoffice.org/68117
Tested-by: Jenkins
Reviewed-by: 's avatarMatteo Casalin <matteo.casalin@yahoo.com>
üst 234f4ef4
......@@ -823,9 +823,9 @@ void HeaderFooterParser::convertFontName( const OUString& rName )
void HeaderFooterParser::convertFontStyle( const OUString& rStyle )
{
maFontModel.mbBold = maFontModel.mbItalic = false;
sal_Int32 nPos = 0;
sal_Int32 nLen = rStyle.getLength();
while( (0 <= nPos) && (nPos < nLen) )
if (rStyle.isEmpty())
return;
for( sal_Int32 nPos{ 0 }; nPos>=0; )
{
OString aToken = OUStringToOString( rStyle.getToken( 0, ' ', nPos ), RTL_TEXTENCODING_UTF8 ).toAsciiLowerCase();
if( !aToken.isEmpty() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment