Fix for bug #7495: [PP]Undo on Linux shows intermediate steps.
Modified Undo() and Redo() to call Begin/EndUpdateViewBatch(). git-svn-id: svn://10.0.0.236/trunk@38453 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
11e8a5e806
commit
d0b855c6a7
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user