зеркало из https://github.com/mozilla/pjs.git
Fix for bug #7495: [PP]Undo on Linux shows intermediate steps.
Modified Undo() and Redo() to call Begin/EndUpdateViewBatch().
This commit is contained in:
Родитель
007ce38f0f
Коммит
ca5bda6648
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче