|
|
|
Lines 867-887
WordSplitState::ClassifyCharacter(PRInt3
|
Link Here
|
|---|
|
| 867 |
return CHAR_CLASS_SEPARATOR; |
867 |
return CHAR_CLASS_SEPARATOR; |
| 868 |
if (ClassifyCharacter(aIndex + 1, false) != CHAR_CLASS_WORD) |
868 |
if (ClassifyCharacter(aIndex + 1, false) != CHAR_CLASS_WORD) |
| 869 |
return CHAR_CLASS_SEPARATOR; |
869 |
return CHAR_CLASS_SEPARATOR; |
| 870 |
|
870 |
|
| 871 |
// char on either side is a word, this counts as a word |
871 |
// char on either side is a word, this counts as a word |
| 872 |
return CHAR_CLASS_WORD; |
872 |
return CHAR_CLASS_WORD; |
| 873 |
} |
873 |
} |
| 874 |
|
874 |
|
| 875 |
// all other punctuation |
875 |
// all other punctuation (only if is first char of the word or last) |
| 876 |
if (charCategory == nsIUGenCategory::kSeparator || |
876 |
// if is last char, can not be a dot (abbreviations) |
|
|
877 |
if ((aIndex == 0 || |
| 878 |
((aIndex == PRInt32(mDOMWordText.Length())-1 && |
| 879 |
mDOMWordText[aIndex] != '.'))) && |
| 880 |
(charCategory == nsIUGenCategory::kSeparator || |
| 877 |
charCategory == nsIUGenCategory::kOther || |
881 |
charCategory == nsIUGenCategory::kOther || |
| 878 |
charCategory == nsIUGenCategory::kPunctuation || |
882 |
charCategory == nsIUGenCategory::kPunctuation || |
| 879 |
charCategory == nsIUGenCategory::kSymbol) |
883 |
charCategory == nsIUGenCategory::kSymbol)) |
| 880 |
return CHAR_CLASS_SEPARATOR; |
884 |
return CHAR_CLASS_SEPARATOR; |
| 881 |
|
885 |
|
| 882 |
// any other character counts as a word |
886 |
// any other character counts as a word |
| 883 |
return CHAR_CLASS_WORD; |
887 |
return CHAR_CLASS_WORD; |
| 884 |
} |
888 |
} |
| 885 |
|
889 |
|
| 886 |
|
890 |
|
| 887 |
// WordSplitState::Advance |
891 |
// WordSplitState::Advance |