Do the correction of caret position due to trimmed whitespace only when the caret is logically after the whitespace. bug=336408 r=rbs sr=roc

This commit is contained in:
uriber%gmail.com 2006-09-25 11:39:10 +00:00
Родитель d54c650b7b
Коммит 5845b74545
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -4427,14 +4427,15 @@ nsTextFrame::GetPointFromOffset(nsPresContext* aPresContext,
else
{
PRInt32 totalLength = mContent->TextLength(); // length up to the last-in-flow frame
if ((hitLength == textLength) && (inOffset = mContentLength) &&
if ((hitLength == textLength) && (inOffset == mContentLength) &&
(mContentOffset + mContentLength == totalLength)) {
// no need to re-measure when at the end of the last-in-flow
}
else
inRendContext->GetWidth(paintBuffer.mBuffer, hitLength, width);
}
if ((hitLength == textLength) && (TEXT_TRIMMED_WS & mState)) {
if ((hitLength == textLength && inOffset > 0 && ip[inOffset] == ip[inOffset-1])
&& (TEXT_TRIMMED_WS & mState)) {
//
// Offset must be after a space that has
// been trimmed off the end of the frame.