new fix for table selection into and out. works great.

This commit is contained in:
mjudge%netscape.com 1999-09-02 00:48:15 +00:00
parent abc3703399
commit bcbb9f3512

View File

@ -2166,17 +2166,37 @@ nsDOMSelection::FixupSelectionPoints(nsIDOMRange *aRange , nsDirection *aDir, PR
if (!found) if (!found)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
}
if (FetchAnchorNode() == startNode.get() && FetchFocusNode() == endNode.get() &&
FetchAnchorOffset() == startOffset && FetchFocusOffset() == endOffset)
{
*aFixupState = PR_FALSE;
return NS_ERROR_FAILURE;//nothing to do
} }
if (*aDir == eDirNext)
{
if (FetchAnchorNode() == startNode.get() && FetchFocusNode() == endNode.get() &&
FetchAnchorOffset() == startOffset && FetchFocusOffset() == endOffset)
{
*aFixupState = PR_FALSE;
return NS_ERROR_FAILURE;//nothing to do
}
}
else
{
if (FetchAnchorNode() == endNode.get() && FetchFocusNode() == startNode.get() &&
FetchAnchorOffset() == endOffset && FetchFocusOffset() == startOffset)
{
*aFixupState = PR_FALSE;
return NS_ERROR_FAILURE;//nothing to do
}
}
if (mFixupState && !dirtyend && !dirtystart)//no mor fixup! all bets off
{
dirtystart = PR_TRUE;//force a reset of anchor positions
dirtystart = PR_TRUE;
*aFixupState = PR_TRUE;//redraw all selection here
mFixupState = PR_FALSE;//no more fixup for next time
}
else
if ((dirtystart || dirtyend) && *aDir != mDirection) //fixup took place but new direction all bets are off if ((dirtystart || dirtyend) && *aDir != mDirection) //fixup took place but new direction all bets are off
{ {
*aFixupState = PR_TRUE; *aFixupState = PR_TRUE;
mFixupState = PR_FALSE; //mFixupState = PR_FALSE;
} }
else else
if (dirtystart && (FetchAnchorNode() != startNode.get() || FetchAnchorOffset() != startOffset)) if (dirtystart && (FetchAnchorNode() != startNode.get() || FetchAnchorOffset() != startOffset))
@ -2192,7 +2212,7 @@ nsDOMSelection::FixupSelectionPoints(nsIDOMRange *aRange , nsDirection *aDir, PR
} }
else else
{ {
mFixupState = PR_FALSE; mFixupState = dirtystart || dirtyend;
*aFixupState = PR_FALSE; *aFixupState = PR_FALSE;
} }
if (dirtystart || dirtyend){ if (dirtystart || dirtyend){