Fix for bug #7495: [PP]Undo on Linux shows intermediate steps.

Modified Undo() and Redo() to call Begin/EndUpdateViewBatch().
This commit is contained in:
kin%netscape.com 1999-07-06 23:02:12 +00:00
Родитель 8c6b3f72a0
Коммит bc437183b9
2 изменённых файлов: 56 добавлений и 58 удалений

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

@ -913,27 +913,26 @@ nsEditor::Undo(PRUint32 aCount)
if (gNoisy) { printf("Editor::Undo ----------\n"); }
nsresult result = NS_OK;
nsCOMPtr<nsIDOMSelection>selection;
nsresult selectionResult = GetSelection(getter_AddRefs(selection));
if (NS_SUCCEEDED(selectionResult) && selection) {
selection->StartBatchChanges();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
result = mTxnMgr->Undo();
if (NS_SUCCEEDED(result))
result = DoAfterUndoTransaction();
BeginUpdateViewBatch();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
result = mTxnMgr->Undo();
if (NS_SUCCEEDED(result))
result = DoAfterUndoTransaction();
if (NS_FAILED(result))
break;
}
if (NS_FAILED(result))
break;
}
selection->EndBatchChanges();
}
EndUpdateViewBatch();
return result;
}
@ -949,22 +948,22 @@ nsEditor::Redo(PRUint32 aCount)
if (gNoisy) { printf("Editor::Redo ----------\n"); }
nsresult result = NS_OK;
nsCOMPtr<nsIDOMSelection>selection;
nsresult selectionResult = GetSelection(getter_AddRefs(selection));
if (NS_SUCCEEDED(selectionResult) && selection) {
selection->StartBatchChanges();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
BeginUpdateViewBatch();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
result = mTxnMgr->Redo();
if (NS_FAILED(result))
break;
}
result = mTxnMgr->Redo();
if (NS_FAILED(result))
break;
}
selection->EndBatchChanges();
}
EndUpdateViewBatch();
return result;
}

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

@ -913,27 +913,26 @@ nsEditor::Undo(PRUint32 aCount)
if (gNoisy) { printf("Editor::Undo ----------\n"); }
nsresult result = NS_OK;
nsCOMPtr<nsIDOMSelection>selection;
nsresult selectionResult = GetSelection(getter_AddRefs(selection));
if (NS_SUCCEEDED(selectionResult) && selection) {
selection->StartBatchChanges();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
result = mTxnMgr->Undo();
if (NS_SUCCEEDED(result))
result = DoAfterUndoTransaction();
BeginUpdateViewBatch();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
result = mTxnMgr->Undo();
if (NS_SUCCEEDED(result))
result = DoAfterUndoTransaction();
if (NS_FAILED(result))
break;
}
if (NS_FAILED(result))
break;
}
selection->EndBatchChanges();
}
EndUpdateViewBatch();
return result;
}
@ -949,22 +948,22 @@ nsEditor::Redo(PRUint32 aCount)
if (gNoisy) { printf("Editor::Redo ----------\n"); }
nsresult result = NS_OK;
nsCOMPtr<nsIDOMSelection>selection;
nsresult selectionResult = GetSelection(getter_AddRefs(selection));
if (NS_SUCCEEDED(selectionResult) && selection) {
selection->StartBatchChanges();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
BeginUpdateViewBatch();
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
PRUint32 i=0;
for ( ; i<aCount; i++)
{
result = mTxnMgr->Redo();
if (NS_FAILED(result))
break;
}
result = mTxnMgr->Redo();
if (NS_FAILED(result))
break;
}
selection->EndBatchChanges();
}
EndUpdateViewBatch();
return result;
}