r = ftang
Fixed non-ascii forward wordjump problem.
This commit is contained in:
shanjian%netscape.com 2000-05-16 19:51:09 +00:00
parent 6f9df087ce
commit e79533211d
2 changed files with 30 additions and 10 deletions

View File

@ -3333,19 +3333,29 @@ nsTextFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
//check for whitespace next.
keepSearching = PR_TRUE;
aPos->mEatingWS = PR_TRUE;
while (!isWhitespace &&
tx.GetNextWord(PR_FALSE, &wordLen, &contentLen, &isWhitespace, &wasTransformed, PR_TRUE, PR_FALSE)){
if (!isWhitespace){
if (tx.GetNextWord(PR_FALSE, &wordLen, &contentLen, &isWhitespace, &wasTransformed, PR_TRUE, PR_FALSE)){
#ifdef DEBUGWORDJUMP
printf("2-GetNextWord return non null, wordLen%d, contentLen%d isWhitespace=%s\n",
wordLen, contentLen, isWhitespace ? "WS" : "NOT WS");
#endif
aPos->mContentOffset += contentLen;
keepSearching = PR_FALSE;
if (isWhitespace)
aPos->mContentOffset += contentLen;
keepSearching = PR_FALSE;
found = PR_TRUE;
}
}
else //we just need to jump the space, done here
{
keepSearching = PR_FALSE;
found = PR_TRUE;
}
}
else if (aPos->mEatingWS)
{
aPos->mContentOffset = mContentOffset;
found = isWhitespace;
found = PR_TRUE;
}
if (!isWhitespace){
aPos->mEatingWS = PR_FALSE;
}

View File

@ -3333,19 +3333,29 @@ nsTextFrame::PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos)
//check for whitespace next.
keepSearching = PR_TRUE;
aPos->mEatingWS = PR_TRUE;
while (!isWhitespace &&
tx.GetNextWord(PR_FALSE, &wordLen, &contentLen, &isWhitespace, &wasTransformed, PR_TRUE, PR_FALSE)){
if (!isWhitespace){
if (tx.GetNextWord(PR_FALSE, &wordLen, &contentLen, &isWhitespace, &wasTransformed, PR_TRUE, PR_FALSE)){
#ifdef DEBUGWORDJUMP
printf("2-GetNextWord return non null, wordLen%d, contentLen%d isWhitespace=%s\n",
wordLen, contentLen, isWhitespace ? "WS" : "NOT WS");
#endif
aPos->mContentOffset += contentLen;
keepSearching = PR_FALSE;
if (isWhitespace)
aPos->mContentOffset += contentLen;
keepSearching = PR_FALSE;
found = PR_TRUE;
}
}
else //we just need to jump the space, done here
{
keepSearching = PR_FALSE;
found = PR_TRUE;
}
}
else if (aPos->mEatingWS)
{
aPos->mContentOffset = mContentOffset;
found = isWhitespace;
found = PR_TRUE;
}
if (!isWhitespace){
aPos->mEatingWS = PR_FALSE;
}