зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
5f6735e270
Коммит
fdb1657ecb
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче