Chromium Code Reviews| Index: Source/platform/fonts/Character.cpp |
| diff --git a/Source/platform/fonts/Character.cpp b/Source/platform/fonts/Character.cpp |
| index 9ae36fc83ca78d1ffee41b510d576eb556914cdd..22d362c61207f78b0ec2ec2633fcaad32a7e7ee8 100644 |
| --- a/Source/platform/fonts/Character.cpp |
| +++ b/Source/platform/fonts/Character.cpp |
| @@ -341,6 +341,11 @@ bool Character::isCJKIdeographOrSymbol(UChar32 c) |
| unsigned Character::expansionOpportunityCount(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion, const TextJustify textJustify) |
| { |
| + if (length == 0) { |
| + isAfterExpansion = false; |
|
kojii
2014/12/05 06:23:22
Why do we need to set |isAfterExpansion = false| h
dw.im
2014/12/05 07:16:42
Because the caller use this value after getting re
kojii
2014/12/05 13:11:21
The |isAfterExpansion| is in-out parameter, not ou
|
| + return 0; |
| + } |
| + |
| unsigned count = 0; |
| if (textJustify == TextJustifyDistribute) { |
| count = length - 1; |
| @@ -357,7 +362,7 @@ unsigned Character::expansionOpportunityCount(const LChar* characters, size_t le |
| } |
| } |
| } |
| - int lastCharacter = (direction == LTR) ? length - 1 : 0; |
| + size_t lastCharacter = (direction == LTR) ? length - 1 : 0; |
| isAfterExpansion = treatAsSpace(characters[lastCharacter]); |
| return count; |