fixed a minor problem with merging type-in transactions.

This commit is contained in:
buster%netscape.com 1999-01-28 17:19:24 +00:00
Родитель 78d4cd7331
Коммит a0bfc18e76
2 изменённых файлов: 6 добавлений и 4 удалений

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

@ -56,7 +56,8 @@ nsresult InsertTextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
*aDidMerge=PR_FALSE;
if ((nsnull!=aDidMerge) && (nsnull!=aTransaction))
{
// if aTransaction isa InsertTextTxn, absorb it
// if aTransaction isa InsertTextTxn, and if the selection hasn't changed,
// then absorb it
nsCOMPtr<InsertTextTxn> otherTxn(aTransaction);
nsresult result=NS_OK;// = aTransaction->QueryInterface(kInsertTextTxnIID, getter_AddRefs(otherTxn));
if (NS_SUCCEEDED(result) && (otherTxn))
@ -64,8 +65,8 @@ nsresult InsertTextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
nsAutoString otherData;
otherTxn->GetData(otherData);
mStringToInsert += otherData;
*aDidMerge = PR_TRUE;
}
*aDidMerge = PR_TRUE;
}
return NS_OK;
}

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

@ -56,7 +56,8 @@ nsresult InsertTextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
*aDidMerge=PR_FALSE;
if ((nsnull!=aDidMerge) && (nsnull!=aTransaction))
{
// if aTransaction isa InsertTextTxn, absorb it
// if aTransaction isa InsertTextTxn, and if the selection hasn't changed,
// then absorb it
nsCOMPtr<InsertTextTxn> otherTxn(aTransaction);
nsresult result=NS_OK;// = aTransaction->QueryInterface(kInsertTextTxnIID, getter_AddRefs(otherTxn));
if (NS_SUCCEEDED(result) && (otherTxn))
@ -64,8 +65,8 @@ nsresult InsertTextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
nsAutoString otherData;
otherTxn->GetData(otherData);
mStringToInsert += otherData;
*aDidMerge = PR_TRUE;
}
*aDidMerge = PR_TRUE;
}
return NS_OK;
}