[Libreoffice-commits] core.git: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Mar 5 21:28:07 UTC 2019
sc/source/filter/oox/pagesettings.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 9e1dfe405cd597c80d63a2138c36cebd4e98400e
Author: Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Feb 17 18:21:58 2019 +0100
Commit: Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Tue Mar 5 22:27:39 2019 +0100
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: Matteo Casalin <matteo.casalin at yahoo.com>
diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx
index 32d6ddc55478..7afa498e828e 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -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() )
More information about the Libreoffice-commits
mailing list