{ nsCOMPtr<nsITransaction> txn; rv = mTxnMgr->PeekUndoStack(getter_AddRefs(txn)); if (NS_SUCCEEDED(rv) && txn) { nsCOMPtr<nsMsgTxn> msgTxn = do_QueryInterface(txn, &rv); if (NS_SUCCEEDED(rv) && msgTxn) msgTxn->SetMsgWindow(msgWindow); } mTxnMgr->UndoTransaction(); }
mTxnMgr->Undo();
nsMessenger::Undo(nsIMsgWindow *msgWindow){  nsresult rv = NS_OK;  if (mTxnMgr)  {    PRInt32 numTxn = 0;    rv = mTxnMgr->GetNumberOfUndoItems(&numTxn);    if (NS_SUCCEEDED(rv) && numTxn > 0)    {        nsCOMPtr<nsITransaction> txn;        rv = mTxnMgr->PeekUndoStack(getter_AddRefs(txn));        if (NS_SUCCEEDED(rv) && txn)        {            nsCOMPtr<nsMsgTxn> msgTxn = do_QueryInterface(txn, &rv);            if (NS_SUCCEEDED(rv) && msgTxn)                msgTxn->SetMsgWindow(msgWindow);        }        mTxnMgr->UndoTransaction();    }  }  return rv;}