fixed a problem with asserts trying to merge empty aggregate transactions.

if the aggregate transaction is empty, don't execute it.  It's not technically
illegal, but it's a waste, and it causes the assert.
This commit is contained in:
buster%netscape.com 1999-09-21 20:46:36 +00:00
Родитель 57cc4f180e
Коммит 1ee85a7538
2 изменённых файлов: 28 добавлений и 2 удалений

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

@ -1481,7 +1481,20 @@ NS_IMETHODIMP nsEditor::InsertTextImpl(const nsString& aStringToInsert)
}
else if (NS_ERROR_EDITOR_NO_TEXTNODE==result)
{
result = Do(aggTxn);
// only execute the aggTxn if we actually populated it with at least one sub-txn
PRInt32 count=0;
aggTxn->GetCount(&count);
if (0!=count)
{
result = Do(aggTxn);
}
else
{
result = NS_OK;
}
// create the text node
if (NS_SUCCEEDED(result))
{
nsCOMPtr<nsIDOMSelection> selection;

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

@ -1481,7 +1481,20 @@ NS_IMETHODIMP nsEditor::InsertTextImpl(const nsString& aStringToInsert)
}
else if (NS_ERROR_EDITOR_NO_TEXTNODE==result)
{
result = Do(aggTxn);
// only execute the aggTxn if we actually populated it with at least one sub-txn
PRInt32 count=0;
aggTxn->GetCount(&count);
if (0!=count)
{
result = Do(aggTxn);
}
else
{
result = NS_OK;
}
// create the text node
if (NS_SUCCEEDED(result))
{
nsCOMPtr<nsIDOMSelection> selection;