diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-01-19 22:50:16 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-01-27 16:29:16 +0100 |
commit | cb04f8bf4f46c573edcf7be5c33d5f06d89eaff4 (patch) | |
tree | 2c936a75e6c29fd5439fde90ca97d96c2eb97e3e /vcl | |
parent | bfc73ffe42529f39ea33de23f7788732238f2eb1 (diff) |
Get data from full string, without tokenization
Change-Id: I8cdaef18329543cbbe316b9499d6707d645a789d
Reviewed-on: https://gerrit.libreoffice.org/66644
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/ixbm/xbmread.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx index 844b325f5ede..6d88ec57a640 100644 --- a/vcl/source/filter/ixbm/xbmread.cxx +++ b/vcl/source/filter/ixbm/xbmread.cxx @@ -214,17 +214,21 @@ void XBMReader::ParseData( SvStream* pInStm, const OString& aLastLine, XBMFormat if (!aLine.isEmpty()) { sal_Int32 nIndex = 0; - while (nRow < nHeight) + const sal_Int32 nLen {aLine.getLength()}; + while (nRow<nHeight && nIndex<nLen) { - const OString aToken(aLine.getToken(0, ',', nIndex)); - const sal_Int32 nLen = aToken.getLength(); bool bProcessed = false; nBit = nDigits = nValue = 0; - for (sal_Int32 n = 0; n < nLen; ++n) + while (nIndex<nLen) { - const unsigned char cChar = aToken[n]; + const unsigned char cChar = aLine[nIndex]; + + ++nIndex; + if (cChar==',') // sequence completed, ',' already skipped for next loop + break; + const short nTable = pHexTable[ cChar ]; if( rtl::isAsciiHexDigit( cChar ) || !nTable ) @@ -252,9 +256,6 @@ void XBMReader::ParseData( SvStream* pInStm, const OString& aLastLine, XBMFormat nRow++; } } - - if (nIndex == -1) - break; } } } |