mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
TransactionManager fix for bug #11590: eliminate NS_COMFALSE
Modified all nsITransactionListener::Will* methods and implementations to use an aInterrupt argument. mozilla/editor/base/nsEditorTxnLog.cpp mozilla/editor/base/nsEditorTxnLog.h mozilla/editor/txmgr/public/nsITransactionListener.h mozilla/editor/txmgr/src/nsTransactionItem.cpp mozilla/editor/txmgr/src/nsTransactionManager.cpp mozilla/editor/txmgr/src/nsTransactionManager.h r=brade@netscape.com
This commit is contained in:
parent
86f919a325
commit
ef66dcd123
@ -89,7 +89,7 @@ nsEditorTxnLog::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -127,7 +127,7 @@ nsEditorTxnLog::DidDo(nsITransactionManager *aTxMgr, nsITransaction *aTransactio
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -183,7 +183,7 @@ nsEditorTxnLog::DidUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransact
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -239,7 +239,7 @@ nsEditorTxnLog::DidRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransact
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillBeginBatch(nsITransactionManager *aTxMgr)
|
||||
nsEditorTxnLog::WillBeginBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -273,7 +273,7 @@ nsEditorTxnLog::DidBeginBatch(nsITransactionManager *aTxMgr, nsresult aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillEndBatch(nsITransactionManager *aTxMgr)
|
||||
nsEditorTxnLog::WillEndBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -307,7 +307,7 @@ nsEditorTxnLog::DidEndBatch(nsITransactionManager *aTxMgr, nsresult aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
|
@ -54,17 +54,17 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/* nsITransactionListener method implementations. */
|
||||
NS_IMETHOD WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, nsresult aDoResult);
|
||||
NS_IMETHOD WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, nsresult aUndoResult);
|
||||
NS_IMETHOD WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, nsresult aRedoResult);
|
||||
NS_IMETHOD WillBeginBatch(nsITransactionManager *aTxMgr);
|
||||
NS_IMETHOD WillBeginBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidBeginBatch(nsITransactionManager *aTxMgr, nsresult aResult);
|
||||
NS_IMETHOD WillEndBatch(nsITransactionManager *aTxMgr);
|
||||
NS_IMETHOD WillEndBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidEndBatch(nsITransactionManager *aTxMgr, nsresult aResult);
|
||||
NS_IMETHOD WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction, PRBool aDidMerge, nsresult aMergeResult);
|
||||
|
||||
|
||||
|
@ -89,7 +89,7 @@ nsEditorTxnLog::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -127,7 +127,7 @@ nsEditorTxnLog::DidDo(nsITransactionManager *aTxMgr, nsITransaction *aTransactio
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -183,7 +183,7 @@ nsEditorTxnLog::DidUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransact
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -239,7 +239,7 @@ nsEditorTxnLog::DidRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransact
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillBeginBatch(nsITransactionManager *aTxMgr)
|
||||
nsEditorTxnLog::WillBeginBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -273,7 +273,7 @@ nsEditorTxnLog::DidBeginBatch(nsITransactionManager *aTxMgr, nsresult aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillEndBatch(nsITransactionManager *aTxMgr)
|
||||
nsEditorTxnLog::WillEndBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
@ -307,7 +307,7 @@ nsEditorTxnLog::DidEndBatch(nsITransactionManager *aTxMgr, nsresult aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorTxnLog::WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction)
|
||||
nsEditorTxnLog::WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
LOCK_LOG(this);
|
||||
|
||||
|
@ -54,17 +54,17 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/* nsITransactionListener method implementations. */
|
||||
NS_IMETHOD WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidDo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, nsresult aDoResult);
|
||||
NS_IMETHOD WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidUndo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, nsresult aUndoResult);
|
||||
NS_IMETHOD WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidRedo(nsITransactionManager *aTxMgr, nsITransaction *aTransaction, nsresult aRedoResult);
|
||||
NS_IMETHOD WillBeginBatch(nsITransactionManager *aTxMgr);
|
||||
NS_IMETHOD WillBeginBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidBeginBatch(nsITransactionManager *aTxMgr, nsresult aResult);
|
||||
NS_IMETHOD WillEndBatch(nsITransactionManager *aTxMgr);
|
||||
NS_IMETHOD WillEndBatch(nsITransactionManager *aTxMgr, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidEndBatch(nsITransactionManager *aTxMgr, nsresult aResult);
|
||||
NS_IMETHOD WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction);
|
||||
NS_IMETHOD WillMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
NS_IMETHOD DidMerge(nsITransactionManager *aTxMgr, nsITransaction *aTopTransaction, nsITransaction *aTransaction, PRBool aDidMerge, nsresult aMergeResult);
|
||||
|
||||
|
||||
|
@ -52,13 +52,14 @@ public:
|
||||
* Do() method.
|
||||
* @param aManager the transaction manager doing the transaction.
|
||||
* @param aTransaction the transaction being done.
|
||||
* @param aInterrupt listeners should set this to PR_TRUE if they
|
||||
* want to interrupt normal control flow, without throwing an error.
|
||||
* @result error status returned by the listener. NS_OK
|
||||
* should be used to indicate no error, proceed with normal control
|
||||
* flow. NS_COMFALSE can be returned by the listener to
|
||||
* indicate no error, interrupt normal control flow.
|
||||
* should be used to indicate no error, proceed with normal control flow.
|
||||
*/
|
||||
NS_IMETHOD WillDo(nsITransactionManager *aManager,
|
||||
nsITransaction *aTransaction) = 0;
|
||||
nsITransaction *aTransaction,
|
||||
PRBool *aInterrupt) = 0;
|
||||
|
||||
/**
|
||||
* Called after a transaction manager calls the Do() method of
|
||||
@ -77,13 +78,14 @@ public:
|
||||
* a transaction.
|
||||
* @param aManager the transaction manager undoing the transaction.
|
||||
* @param aTransaction the transaction being undone.
|
||||
* @param aInterrupt listeners should set this to PR_TRUE if they
|
||||
* want to interrupt normal control flow, without throwing an error.
|
||||
* @result error status returned by the listener. NS_OK
|
||||
* should be used to indicate no error, proceed with normal control
|
||||
* flow. NS_COMFALSE can be returned by the listener to
|
||||
* indicate no error, interrupt normal control flow.
|
||||
* should be used to indicate no error, proceed with normal control flow.
|
||||
*/
|
||||
NS_IMETHOD WillUndo(nsITransactionManager *aManager,
|
||||
nsITransaction *aTransaction) = 0;
|
||||
nsITransaction *aTransaction,
|
||||
PRBool *aInterrupt) = 0;
|
||||
|
||||
/**
|
||||
* Called after a transaction manager calls the Undo() method of
|
||||
@ -102,13 +104,14 @@ public:
|
||||
* a transaction.
|
||||
* @param aManager the transaction manager redoing the transaction.
|
||||
* @param aTransaction the transaction being redone.
|
||||
* @param aInterrupt listeners should set this to PR_TRUE if they
|
||||
* want to interrupt normal control flow, without throwing an error.
|
||||
* @result error status returned by the listener. NS_OK
|
||||
* should be used to indicate no error, proceed with normal control
|
||||
* flow. NS_COMFALSE can be returned by the listener to
|
||||
* indicate no error, interrupt normal control flow.
|
||||
* should be used to indicate no error, proceed with normal control flow.
|
||||
*/
|
||||
NS_IMETHOD WillRedo(nsITransactionManager *aManager,
|
||||
nsITransaction *aTransaction) = 0;
|
||||
nsITransaction *aTransaction,
|
||||
PRBool *aInterrupt) = 0;
|
||||
|
||||
/**
|
||||
* Called after a transaction manager calls the Redo() method of
|
||||
@ -125,12 +128,13 @@ public:
|
||||
/**
|
||||
* Called before a transaction manager begins a batch.
|
||||
* @param aManager the transaction manager beginning a batch.
|
||||
* @param aInterrupt listeners should set this to PR_TRUE if they
|
||||
* want to interrupt normal control flow, without throwing an error.
|
||||
* @result error status returned by the listener. NS_OK
|
||||
* should be used to indicate no error, proceed with normal control
|
||||
* flow. NS_COMFALSE can be returned by the listener to
|
||||
* indicate no error, interrupt normal control flow.
|
||||
* should be used to indicate no error, proceed with normal control flow.
|
||||
*/
|
||||
NS_IMETHOD WillBeginBatch(nsITransactionManager *aManager) = 0;
|
||||
NS_IMETHOD WillBeginBatch(nsITransactionManager *aManager,
|
||||
PRBool *aInterrupt) = 0;
|
||||
|
||||
/**
|
||||
* Called after a transaction manager begins a batch.
|
||||
@ -144,12 +148,13 @@ public:
|
||||
/**
|
||||
* Called before a transaction manager ends a batch.
|
||||
* @param aManager the transaction manager ending a batch.
|
||||
* @param aInterrupt listeners should set this to PR_TRUE if they
|
||||
* want to interrupt normal control flow, without throwing an error.
|
||||
* @result error status returned by the listener. NS_OK
|
||||
* should be used to indicate no error, proceed with normal control
|
||||
* flow. NS_COMFALSE can be returned by the listener to
|
||||
* indicate no error, interrupt normal control flow.
|
||||
* should be used to indicate no error, proceed with normal control flow.
|
||||
*/
|
||||
NS_IMETHOD WillEndBatch(nsITransactionManager *aManager) = 0;
|
||||
NS_IMETHOD WillEndBatch(nsITransactionManager *aManager,
|
||||
PRBool *aInterrupt) = 0;
|
||||
|
||||
/**
|
||||
* Called after a transaction manager ends a batch.
|
||||
@ -167,14 +172,15 @@ public:
|
||||
* @param aManager the transaction manager ending a batch.
|
||||
* @param aTopTransaction the transaction at the top of the undo stack.
|
||||
* @param aTransactionToMerge the transaction to merge.
|
||||
* @param aInterrupt listeners should set this to PR_TRUE if they
|
||||
* want to interrupt normal control flow, without throwing an error.
|
||||
* @result error status returned by the listener. NS_OK
|
||||
* should be used to indicate no error, proceed with normal control
|
||||
* flow. NS_COMFALSE can be returned by the listener to
|
||||
* indicate no error, interrupt normal control flow.
|
||||
* should be used to indicate no error, proceed with normal control flow.
|
||||
*/
|
||||
NS_IMETHOD WillMerge(nsITransactionManager *aManager,
|
||||
nsITransaction *aTopTransaction,
|
||||
nsITransaction *aTransactionToMerge) = 0;
|
||||
nsITransaction *aTransactionToMerge,
|
||||
PRBool *aInterrupt) = 0;
|
||||
|
||||
/**
|
||||
* Called after a transaction manager tries to merge
|
||||
@ -185,10 +191,10 @@ public:
|
||||
* @param aTransactionToMerge the transaction to merge.
|
||||
* @param aDidMerge true if transaction was merged, else false.
|
||||
* @param aMergeResult the nsresult returned after the merge attempt.
|
||||
* @param aInterrupt listeners should set this to PR_TRUE if they
|
||||
* want to interrupt normal control flow, without throwing an error.
|
||||
* @result error status returned by the listener. NS_OK
|
||||
* should be used to indicate no error, proceed with normal control
|
||||
* flow. NS_COMFALSE can be returned by the listener to
|
||||
* indicate no error, interrupt normal control flow.
|
||||
* should be used to indicate no error, proceed with normal control flow.
|
||||
*/
|
||||
NS_IMETHOD DidMerge(nsITransactionManager *aManager,
|
||||
nsITransaction *aTopTransaction,
|
||||
|
@ -165,13 +165,15 @@ nsTransactionItem::UndoChildren(nsTransactionManager *aTxMgr)
|
||||
return result;
|
||||
}
|
||||
|
||||
result = aTxMgr->WillUndoNotify(t);
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = aTxMgr->WillUndoNotify(t, &doInterrupt);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == NS_COMFALSE) {
|
||||
if (doInterrupt) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -254,13 +256,15 @@ nsTransactionItem::RedoChildren(nsTransactionManager *aTxMgr)
|
||||
return result;
|
||||
}
|
||||
|
||||
result = aTxMgr->WillRedoNotify(t);
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = aTxMgr->WillRedoNotify(t, &doInterrupt);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == NS_COMFALSE) {
|
||||
if (doInterrupt) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -135,14 +135,16 @@ nsTransactionManager::Do(nsITransaction *aTransaction)
|
||||
|
||||
LOCK_TX_MANAGER(this);
|
||||
|
||||
result = WillDoNotify(aTransaction);
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = WillDoNotify(aTransaction, &doInterrupt);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == NS_COMFALSE) {
|
||||
if (doInterrupt) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -215,14 +217,16 @@ nsTransactionManager::Undo()
|
||||
return result;
|
||||
}
|
||||
|
||||
result = WillUndoNotify(t);
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = WillUndoNotify(t, &doInterrupt);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == NS_COMFALSE) {
|
||||
if (doInterrupt) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -294,14 +298,16 @@ nsTransactionManager::Redo()
|
||||
return result;
|
||||
}
|
||||
|
||||
result = WillRedoNotify(t);
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = WillRedoNotify(t, &doInterrupt);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == NS_COMFALSE) {
|
||||
if (doInterrupt) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -358,14 +364,16 @@ nsTransactionManager::BeginBatch()
|
||||
|
||||
LOCK_TX_MANAGER(this);
|
||||
|
||||
result = WillBeginBatchNotify();
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = WillBeginBatchNotify(&doInterrupt);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == NS_COMFALSE) {
|
||||
if (doInterrupt) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -417,14 +425,16 @@ nsTransactionManager::EndBatch()
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
result = WillEndBatchNotify();
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = WillEndBatchNotify(&doInterrupt);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == NS_COMFALSE) {
|
||||
if (doInterrupt) {
|
||||
UNLOCK_TX_MANAGER(this);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -722,7 +732,7 @@ nsTransactionManager::ClearRedoStack()
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsTransactionManager::WillDoNotify(nsITransaction *aTransaction)
|
||||
nsTransactionManager::WillDoNotify(nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
if (!mListeners)
|
||||
return NS_OK;
|
||||
@ -737,9 +747,9 @@ nsTransactionManager::WillDoNotify(nsITransaction *aTransaction)
|
||||
if (!listener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
result = listener->WillDo(this, aTransaction);
|
||||
result = listener->WillDo(this, aTransaction, aInterrupt);
|
||||
|
||||
if (NS_FAILED(result) || result == NS_COMFALSE)
|
||||
if (NS_FAILED(result) || *aInterrupt)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -772,7 +782,7 @@ nsTransactionManager::DidDoNotify(nsITransaction *aTransaction, nsresult aDoResu
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsTransactionManager::WillUndoNotify(nsITransaction *aTransaction)
|
||||
nsTransactionManager::WillUndoNotify(nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
if (!mListeners)
|
||||
return NS_OK;
|
||||
@ -787,9 +797,9 @@ nsTransactionManager::WillUndoNotify(nsITransaction *aTransaction)
|
||||
if (!listener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
result = listener->WillUndo(this, aTransaction);
|
||||
result = listener->WillUndo(this, aTransaction, aInterrupt);
|
||||
|
||||
if (NS_FAILED(result) || result == NS_COMFALSE)
|
||||
if (NS_FAILED(result) || *aInterrupt)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -822,7 +832,7 @@ nsTransactionManager::DidUndoNotify(nsITransaction *aTransaction, nsresult aUndo
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsTransactionManager::WillRedoNotify(nsITransaction *aTransaction)
|
||||
nsTransactionManager::WillRedoNotify(nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
if (!mListeners)
|
||||
return NS_OK;
|
||||
@ -837,9 +847,9 @@ nsTransactionManager::WillRedoNotify(nsITransaction *aTransaction)
|
||||
if (!listener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
result = listener->WillRedo(this, aTransaction);
|
||||
result = listener->WillRedo(this, aTransaction, aInterrupt);
|
||||
|
||||
if (NS_FAILED(result) || result == NS_COMFALSE)
|
||||
if (NS_FAILED(result) || *aInterrupt)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -872,7 +882,7 @@ nsTransactionManager::DidRedoNotify(nsITransaction *aTransaction, nsresult aRedo
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsTransactionManager::WillBeginBatchNotify()
|
||||
nsTransactionManager::WillBeginBatchNotify(PRBool *aInterrupt)
|
||||
{
|
||||
if (!mListeners)
|
||||
return NS_OK;
|
||||
@ -887,9 +897,9 @@ nsTransactionManager::WillBeginBatchNotify()
|
||||
if (!listener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
result = listener->WillBeginBatch(this);
|
||||
result = listener->WillBeginBatch(this, aInterrupt);
|
||||
|
||||
if (NS_FAILED(result) || result == NS_COMFALSE)
|
||||
if (NS_FAILED(result) || *aInterrupt)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -922,7 +932,7 @@ nsTransactionManager::DidBeginBatchNotify(nsresult aResult)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsTransactionManager::WillEndBatchNotify()
|
||||
nsTransactionManager::WillEndBatchNotify(PRBool *aInterrupt)
|
||||
{
|
||||
if (!mListeners)
|
||||
return NS_OK;
|
||||
@ -937,9 +947,9 @@ nsTransactionManager::WillEndBatchNotify()
|
||||
if (!listener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
result = listener->WillEndBatch(this);
|
||||
result = listener->WillEndBatch(this, aInterrupt);
|
||||
|
||||
if (NS_FAILED(result) || result == NS_COMFALSE)
|
||||
if (NS_FAILED(result) || *aInterrupt)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -972,7 +982,7 @@ nsTransactionManager::DidEndBatchNotify(nsresult aResult)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsTransactionManager::WillMergeNotify(nsITransaction *aTop, nsITransaction *aTransaction)
|
||||
nsTransactionManager::WillMergeNotify(nsITransaction *aTop, nsITransaction *aTransaction, PRBool *aInterrupt)
|
||||
{
|
||||
if (!mListeners)
|
||||
return NS_OK;
|
||||
@ -987,9 +997,9 @@ nsTransactionManager::WillMergeNotify(nsITransaction *aTop, nsITransaction *aTra
|
||||
if (!listener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
result = listener->WillMerge(this, aTop, aTransaction);
|
||||
result = listener->WillMerge(this, aTop, aTransaction, aInterrupt);
|
||||
|
||||
if (NS_FAILED(result) || result == NS_COMFALSE)
|
||||
if (NS_FAILED(result) || *aInterrupt)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1150,12 +1160,14 @@ nsTransactionManager::EndTransaction()
|
||||
|
||||
if (topTransaction) {
|
||||
|
||||
result = WillMergeNotify(topTransaction, tint);
|
||||
PRBool doInterrupt = PR_FALSE;
|
||||
|
||||
result = WillMergeNotify(topTransaction, tint, &doInterrupt);
|
||||
|
||||
if (NS_FAILED(result))
|
||||
return result;
|
||||
|
||||
if (result != NS_COMFALSE) {
|
||||
if (!doInterrupt) {
|
||||
result = topTransaction->Merge(&didMerge, tint);
|
||||
|
||||
nsresult result2 = DidMergeNotify(topTransaction, tint, didMerge, result);
|
||||
|
@ -81,18 +81,19 @@ public:
|
||||
virtual nsresult ClearUndoStack(void);
|
||||
virtual nsresult ClearRedoStack(void);
|
||||
|
||||
virtual nsresult WillDoNotify(nsITransaction *aTransaction);
|
||||
virtual nsresult WillDoNotify(nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
virtual nsresult DidDoNotify(nsITransaction *aTransaction, nsresult aDoResult);
|
||||
virtual nsresult WillUndoNotify(nsITransaction *aTransaction);
|
||||
virtual nsresult WillUndoNotify(nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
virtual nsresult DidUndoNotify(nsITransaction *aTransaction, nsresult aUndoResult);
|
||||
virtual nsresult WillRedoNotify(nsITransaction *aTransaction);
|
||||
virtual nsresult WillRedoNotify(nsITransaction *aTransaction, PRBool *aInterrupt);
|
||||
virtual nsresult DidRedoNotify(nsITransaction *aTransaction, nsresult aRedoResult);
|
||||
virtual nsresult WillBeginBatchNotify();
|
||||
virtual nsresult WillBeginBatchNotify(PRBool *aInterrupt);
|
||||
virtual nsresult DidBeginBatchNotify(nsresult aResult);
|
||||
virtual nsresult WillEndBatchNotify();
|
||||
virtual nsresult WillEndBatchNotify(PRBool *aInterrupt);
|
||||
virtual nsresult DidEndBatchNotify(nsresult aResult);
|
||||
virtual nsresult WillMergeNotify(nsITransaction *aTop,
|
||||
nsITransaction *aTransaction);
|
||||
nsITransaction *aTransaction,
|
||||
PRBool *aInterrupt);
|
||||
virtual nsresult DidMergeNotify(nsITransaction *aTop,
|
||||
nsITransaction *aTransaction,
|
||||
PRBool aDidMerge,
|
||||
|
Loading…
x
Reference in New Issue
Block a user