fixed bug 13669, wrong password when user typed with 1 or more characters selected

This commit is contained in:
buster%netscape.com 1999-09-14 00:11:22 +00:00
parent fc5232bd1d
commit 4195b67417
2 changed files with 8 additions and 0 deletions

View File

@ -997,6 +997,10 @@ nsTextEditRules::EchoInsertionToPWBuff(nsIDOMSelection *aSelection, nsString *aO
PRInt32 start, end;
nsresult res = mEditor->GetTextSelectionOffsets(aSelection, start, end);
NS_ASSERTION((NS_SUCCEEDED(res)), "getTextSelectionOffsets failed!");
if (end!=start)
{
mPasswordText.Cut(start, end-start);
}
mPasswordText.Insert(*aOutString, start);
#ifdef DEBUG_jfrancis

View File

@ -997,6 +997,10 @@ nsTextEditRules::EchoInsertionToPWBuff(nsIDOMSelection *aSelection, nsString *aO
PRInt32 start, end;
nsresult res = mEditor->GetTextSelectionOffsets(aSelection, start, end);
NS_ASSERTION((NS_SUCCEEDED(res)), "getTextSelectionOffsets failed!");
if (end!=start)
{
mPasswordText.Cut(start, end-start);
}
mPasswordText.Insert(*aOutString, start);
#ifdef DEBUG_jfrancis