diff options
author | Muhammad Haggag <mhaggag@gmail.com> | 2012-08-22 16:46:23 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-28 10:07:37 +0100 |
commit | 48d1979dc3fb4618e04f37e5090c66ddf2fdad3a (patch) | |
tree | f7d631d2da7c0888f01112479c9ff0dbb1d5437b /sw/Makefile | |
parent | 9f14fa5f5f6c6edd596a0bfaa9a24facb5c6d83f (diff) |
fdo#53399 Word count is inconsistent and wrong with non-breaking space
This change replaces lcl_IsSkippableWhitespace with a call to ICU's u_isspace, which covers all Unicode separators. It also updates and fixes one of the SwScanner unit tests.
Bug details:
SwScanner::NextWord skips whitespace before calling into ICU's BreakIterator. The function used to identify whitespace (lcl_IsSkippableWhitespace) doesn't cover the full category of Unicode separators (code [Zs], 18 in total. See: http://www.fileformat.info/info/unicode/category/Zs/index.htm).
Since 0xA0 (no-break space) is not identified as whitespace and not skipped, we end up calling ICU starting at the position 0xA0, asking it to get us the boundary of the next word forward. ICU sees that it's called at the end of a word, and reverses the query direction to backward, and returns the word before. This causes NextWord to think we've hit the end of the string and call it a day, terminating word count for the rest of the line.
Change-Id: I29c89ddb0b26e88da822501253898856b28e3fa5
Reviewed-on: https://gerrit.libreoffice.org/453
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
(cherry picked from commit 3ba107606682b5e675127483a514f0e6580ecfd1)
Signed-off-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/Makefile')
0 files changed, 0 insertions, 0 deletions