127321. r=brade sr=sfrasier. bug that skips getting stuck on word jumping on macs. This feature now may want to be turned on in the windows and unix builds as well.

This commit is contained in:
mjudge%netscape.com 2002-08-08 06:37:01 +00:00
Родитель 85a70f2817
Коммит 5b661f9a3c
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -411,6 +411,11 @@ nsTextTransformer::ScanNormalAsciiText_F_ForWordBreak(PRInt32* aWordLen,
} else {
bp2 += mBufferPos;
}
PRBool readingAlphaNumeric = PR_TRUE; //only used in sWordSelectStopAtPunctuation
//we must know if we are starting in alpha numerics.
if (sWordSelectStopAtPunctuation && offset < fragLen)
readingAlphaNumeric = isalnum((unsigned char)*cp);
for (; offset < fragLen && !breakAfterThis; offset++) {
unsigned char ch = *cp++;
@ -425,7 +430,7 @@ nsTextTransformer::ScanNormalAsciiText_F_ForWordBreak(PRInt32* aWordLen,
else if (XP_IS_SPACE(ch)) {
break;
}
else if (sWordSelectStopAtPunctuation && !isalnum(ch)) {
else if (sWordSelectStopAtPunctuation && ((readingAlphaNumeric && !isalnum(ch)) || (!readingAlphaNumeric && isalnum(ch)) )) {
// on some platforms, punctuation breaks words too.
break;
}

Просмотреть файл

@ -411,6 +411,11 @@ nsTextTransformer::ScanNormalAsciiText_F_ForWordBreak(PRInt32* aWordLen,
} else {
bp2 += mBufferPos;
}
PRBool readingAlphaNumeric = PR_TRUE; //only used in sWordSelectStopAtPunctuation
//we must know if we are starting in alpha numerics.
if (sWordSelectStopAtPunctuation && offset < fragLen)
readingAlphaNumeric = isalnum((unsigned char)*cp);
for (; offset < fragLen && !breakAfterThis; offset++) {
unsigned char ch = *cp++;
@ -425,7 +430,7 @@ nsTextTransformer::ScanNormalAsciiText_F_ForWordBreak(PRInt32* aWordLen,
else if (XP_IS_SPACE(ch)) {
break;
}
else if (sWordSelectStopAtPunctuation && !isalnum(ch)) {
else if (sWordSelectStopAtPunctuation && ((readingAlphaNumeric && !isalnum(ch)) || (!readingAlphaNumeric && isalnum(ch)) )) {
// on some platforms, punctuation breaks words too.
break;
}