fix 76003. fix bidi rendering context state corrupting

check in for simon@softel.co.il
r=dbaron@fas.harvard.edu
sr=kin@netscape.com
This commit is contained in:
ftang%netscape.com 2001-05-16 12:18:19 +00:00
Родитель aeaf1bf4a4
Коммит 6ffc96481f
2 изменённых файлов: 24 добавлений и 0 удалений

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

@ -1016,12 +1016,24 @@ void nsCaret::DrawCaret()
{
if (bidiLevel != mKeyboardRTL)
{
/* if the caret bidi level and the keyboard language direction are not in
* synch, the keyboard language must have been changed by the
* user, and if the caret is in a boundary condition (between left-to-right and
* right-to-left characters) it may have to change position to
* reflect the location in which the next character typed will
* appear. We will call |SelectionLanguageChange| and exit
* without drawing the caret in the old position.
*/
mKeyboardRTL = bidiLevel;
nsCOMPtr<nsISelection> domSelection = do_QueryReferent(mDomSelectionWeak);
if (domSelection)
{
if (NS_SUCCEEDED(domSelection->SelectionLanguageChange(mKeyboardRTL)))
{
PRBool emptyClip;
mRendContext->PopState(emptyClip);
return;
}
}
}
// If keyboard language is RTL, draw the hook on the left; if LTR, to the right

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

@ -1016,12 +1016,24 @@ void nsCaret::DrawCaret()
{
if (bidiLevel != mKeyboardRTL)
{
/* if the caret bidi level and the keyboard language direction are not in
* synch, the keyboard language must have been changed by the
* user, and if the caret is in a boundary condition (between left-to-right and
* right-to-left characters) it may have to change position to
* reflect the location in which the next character typed will
* appear. We will call |SelectionLanguageChange| and exit
* without drawing the caret in the old position.
*/
mKeyboardRTL = bidiLevel;
nsCOMPtr<nsISelection> domSelection = do_QueryReferent(mDomSelectionWeak);
if (domSelection)
{
if (NS_SUCCEEDED(domSelection->SelectionLanguageChange(mKeyboardRTL)))
{
PRBool emptyClip;
mRendContext->PopState(emptyClip);
return;
}
}
}
// If keyboard language is RTL, draw the hook on the left; if LTR, to the right