fix for 127321. r=brade sr=smfr. Fix for word jumping getting stuck on punctuation.
git-svn-id: svn://10.0.0.236/trunk@126678 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
62be4351bb
commit
bac2fdb53d
@ -411,7 +411,12 @@ 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++;
|
||||
if (CH_NBSP == ch) {
|
||||
@ -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,7 +411,12 @@ 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++;
|
||||
if (CH_NBSP == ch) {
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user