[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Tue Jan 16 20:29:10 UTC 2018


 vcl/source/filter/ixbm/xbmread.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 18e9fc8bad056fb7c20ed9a2689928f3c8735020
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 16 16:29:22 2018 +0000

    ofz#5423 Timeout
    
    Change-Id: I4d102c0370f336ed778e4578db697f520cc740b3
    Reviewed-on: https://gerrit.libreoffice.org/48009
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx
index d44ec06aa5a3..9cbfd4ad4b46 100644
--- a/vcl/source/filter/ixbm/xbmread.cxx
+++ b/vcl/source/filter/ixbm/xbmread.cxx
@@ -212,11 +212,10 @@ bool XBMReader::ParseData( SvStream* pInStm, const OString& aLastLine, XBMFormat
 
         if (!aLine.isEmpty())
         {
-            const sal_Int32 nCount = comphelper::string::getTokenCount(aLine, ',');
-
-            for( sal_Int32 i = 0; ( i < nCount ) && ( nRow < nHeight ); ++i )
+            sal_Int32 nIndex = 0;
+            while (nRow < nHeight)
             {
-                const OString aToken(aLine.getToken(i, ','));
+                const OString aToken(aLine.getToken(0, ',', nIndex));
                 const sal_Int32 nLen = aToken.getLength();
                 bool bProcessed = false;
 
@@ -251,6 +250,9 @@ bool XBMReader::ParseData( SvStream* pInStm, const OString& aLastLine, XBMFormat
                         nRow++;
                     }
                 }
+
+                if (nIndex == -1)
+                    break;
             }
         }
     }


More information about the Libreoffice-commits mailing list