Bug 312620 - Bidi: Caret doesn't move correctly when arrowing where line wraps, if the wrapped line starts with a single reverse-direction character. patch from uriber@gmail.com, r+sr=roc.

git-svn-id: svn://10.0.0.236/trunk@182346 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mozilla.mano%sent.com
2005-10-16 23:26:22 +00:00
parent dcb4bd223f
commit a9be5655a9

View File

@@ -395,6 +395,14 @@ private:
PRUint32 aKeycode,
HINT aHint);
void BidiLevelFromClick(nsIContent *aNewFocus, PRUint32 aContentOffset);
NS_IMETHOD GetPrevNextBidiLevels(nsPresContext *aPresContext,
nsIContent *aNode,
PRUint32 aContentOffset,
HINT aHint,
nsIFrame **aPrevFrame,
nsIFrame **aNextFrame,
PRUint8 *aPrevLevel,
PRUint8 *aNextLevel);
#ifdef VISUALSELECTION
NS_IMETHOD VisualSelectFrames(nsPresContext* aContext,
nsIFrame* aCurrentFrame,
@@ -1981,6 +1989,20 @@ nsSelection::GetPrevNextBidiLevels(nsPresContext *aPresContext,
nsIFrame **aNextFrame,
PRUint8 *aPrevLevel,
PRUint8 *aNextLevel)
{
return GetPrevNextBidiLevels(aPresContext, aNode, aContentOffset, mHint,
aPrevFrame, aNextFrame, aPrevLevel, aNextLevel);
}
NS_IMETHODIMP
nsSelection::GetPrevNextBidiLevels(nsPresContext *aPresContext,
nsIContent *aNode,
PRUint32 aContentOffset,
HINT aHint,
nsIFrame **aPrevFrame,
nsIFrame **aNextFrame,
PRUint8 *aPrevLevel,
PRUint8 *aNextLevel)
{
if (!aPrevFrame || !aNextFrame)
return NS_ERROR_NULL_POINTER;
@@ -1993,7 +2015,7 @@ nsSelection::GetPrevNextBidiLevels(nsPresContext *aPresContext,
*aPrevLevel = *aNextLevel = 0;
result = GetFrameForNodeOffset(aNode, aContentOffset, mHint, &currentFrame, &currentOffset);
result = GetFrameForNodeOffset(aNode, aContentOffset, aHint, &currentFrame, &currentOffset);
if (NS_FAILED(result))
return result;
currentFrame->GetOffsets(frameStart, frameEnd);
@@ -2258,7 +2280,7 @@ void nsSelection::BidiLevelFromMove(nsPresContext* aContext,
// Right and Left: the new cursor Bidi level is the level of the character moved over
case nsIDOMKeyEvent::DOM_VK_RIGHT:
case nsIDOMKeyEvent::DOM_VK_LEFT:
GetPrevNextBidiLevels(aContext, aNode, aContentOffset, &firstFrame, &secondFrame, &firstLevel, &secondLevel);
GetPrevNextBidiLevels(aContext, aNode, aContentOffset, aHint, &firstFrame, &secondFrame, &firstLevel, &secondLevel);
if (HINTLEFT == aHint)
aPresShell->SetCaretBidiLevel(firstLevel);
else