Bug 210110: selection at end of line spans multiple lines in embedded test editor. r+sr=bzbarsky

This commit is contained in:
smontagu%netscape.com 2003-07-11 23:34:42 +00:00
Родитель f6bc1233c8
Коммит aa8581e487
2 изменённых файлов: 12 добавлений и 10 удалений

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

@ -4131,12 +4131,12 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
if (NS_FAILED(result))
return result;
nsISupports *isupports = nsnull;
nsRect testRect;
#ifdef IBMBIDI
nsIFrame *newFrame;
PRBool isBidiGhostFrame = PR_FALSE;
PRBool selectable = PR_TRUE; //usually fine
while (testRect.IsEmpty() || !selectable) {
do {
if (lineIsRTL && lineJump)
if (aPos->mDirection == eDirPrevious)
result = frameTraversal->Next();
@ -4175,8 +4175,9 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
if (nsLayoutAtoms::textFrame != frameType.get() )
continue; //we should NOT be getting stuck on the same piece of content on the same line. skip to next line.
}
testRect = newFrame->GetRect();
if ((mState & NS_FRAME_IS_BIDI) && testRect.IsEmpty())
isBidiGhostFrame = (newFrame->GetRect().IsEmpty() &&
(newFrame->GetStateBits() & NS_FRAME_IS_BIDI));
if (isBidiGhostFrame)
{
// If the rectangle is empty and the NS_FRAME_IS_BIDI flag is set, this is most likely
// a non-renderable frame created at the end of the line by Bidi reordering.
@ -4250,7 +4251,7 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
newFrame->IsSelectable(&selectable, nsnull);
if (!selectable)
lineJump = PR_FALSE;
}
} while (isBidiGhostFrame || !selectable);
#endif // IBMBIDI
if (aPos->mDirection == eDirNext)
aPos->mStartOffset = 0;

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

@ -4131,12 +4131,12 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
if (NS_FAILED(result))
return result;
nsISupports *isupports = nsnull;
nsRect testRect;
#ifdef IBMBIDI
nsIFrame *newFrame;
PRBool isBidiGhostFrame = PR_FALSE;
PRBool selectable = PR_TRUE; //usually fine
while (testRect.IsEmpty() || !selectable) {
do {
if (lineIsRTL && lineJump)
if (aPos->mDirection == eDirPrevious)
result = frameTraversal->Next();
@ -4175,8 +4175,9 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
if (nsLayoutAtoms::textFrame != frameType.get() )
continue; //we should NOT be getting stuck on the same piece of content on the same line. skip to next line.
}
testRect = newFrame->GetRect();
if ((mState & NS_FRAME_IS_BIDI) && testRect.IsEmpty())
isBidiGhostFrame = (newFrame->GetRect().IsEmpty() &&
(newFrame->GetStateBits() & NS_FRAME_IS_BIDI));
if (isBidiGhostFrame)
{
// If the rectangle is empty and the NS_FRAME_IS_BIDI flag is set, this is most likely
// a non-renderable frame created at the end of the line by Bidi reordering.
@ -4250,7 +4251,7 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
newFrame->IsSelectable(&selectable, nsnull);
if (!selectable)
lineJump = PR_FALSE;
}
} while (isBidiGhostFrame || !selectable);
#endif // IBMBIDI
if (aPos->mDirection == eDirNext)
aPos->mStartOffset = 0;