sc/source/filter/oox/pagesettings.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9e1dfe405cd597c80d63a2138c36cebd4e98400e
Author:     Matteo Casalin <matteo.casa...@yahoo.com>
AuthorDate: Sun Feb 17 18:21:58 2019 +0100
Commit:     Matteo Casalin <matteo.casa...@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.casa...@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() )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to