2001-09-26 02:53:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
#include "TransactionItem.h"
|
2018-03-22 16:15:54 +03:00
|
|
|
|
2012-07-13 10:33:42 +04:00
|
|
|
#include "mozilla/mozalloc.h"
|
2018-03-22 16:15:54 +03:00
|
|
|
#include "mozilla/TransactionManager.h"
|
2018-03-22 17:30:48 +03:00
|
|
|
#include "mozilla/TransactionStack.h"
|
2012-07-13 10:33:42 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsDebug.h"
|
|
|
|
#include "nsError.h"
|
2014-02-27 01:36:35 +04:00
|
|
|
#include "nsISupportsImpl.h"
|
1999-05-27 01:16:25 +04:00
|
|
|
#include "nsITransaction.h"
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
namespace mozilla {
|
2018-03-22 16:15:54 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
TransactionItem::TransactionItem(nsITransaction* aTransaction)
|
|
|
|
: mTransaction(aTransaction), mUndoStack(0), mRedoStack(0) {}
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
TransactionItem::~TransactionItem() {
|
2011-05-17 18:01:36 +04:00
|
|
|
delete mRedoStack;
|
|
|
|
delete mUndoStack;
|
2008-12-10 19:46:36 +03:00
|
|
|
}
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
void TransactionItem::CleanUp() {
|
2013-07-09 21:30:58 +04:00
|
|
|
mData.Clear();
|
|
|
|
mTransaction = nullptr;
|
|
|
|
if (mRedoStack) {
|
|
|
|
mRedoStack->DoUnlink();
|
|
|
|
}
|
|
|
|
if (mUndoStack) {
|
|
|
|
mUndoStack->DoUnlink();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_NATIVE_ADDREF(TransactionItem)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE_WITH_LAST_RELEASE(TransactionItem,
|
2013-07-09 21:30:58 +04:00
|
|
|
CleanUp())
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(TransactionItem)
|
2013-08-02 05:29:05 +04:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TransactionItem)
|
2013-07-09 21:30:58 +04:00
|
|
|
tmp->CleanUp();
|
2009-05-09 08:59:25 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TransactionItem)
|
2013-01-04 10:54:26 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mData)
|
2012-11-15 11:32:40 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTransaction)
|
2009-05-09 08:59:25 +04:00
|
|
|
if (tmp->mRedoStack) {
|
|
|
|
tmp->mRedoStack->DoTraverse(cb);
|
|
|
|
}
|
|
|
|
if (tmp->mUndoStack) {
|
|
|
|
tmp->mUndoStack->DoTraverse(cb);
|
|
|
|
}
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(TransactionItem, AddRef)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(TransactionItem, Release)
|
2009-05-09 08:59:25 +04:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::AddChild(TransactionItem* aTransactionItem) {
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(aTransactionItem, NS_ERROR_NULL_POINTER);
|
1998-12-01 21:35:49 +03:00
|
|
|
|
|
|
|
if (!mUndoStack) {
|
2018-03-22 17:30:48 +03:00
|
|
|
mUndoStack = new TransactionStack(TransactionStack::FOR_UNDO);
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
mUndoStack->Push(aTransactionItem);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
already_AddRefed<nsITransaction> TransactionItem::GetTransaction() {
|
2012-06-19 17:23:36 +04:00
|
|
|
nsCOMPtr<nsITransaction> txn = mTransaction;
|
|
|
|
return txn.forget();
|
1998-12-02 20:40:56 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::GetIsBatch(bool* aIsBatch) {
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(aIsBatch, NS_ERROR_NULL_POINTER);
|
2001-03-09 17:23:59 +03:00
|
|
|
*aIsBatch = !mTransaction;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::GetNumberOfChildren(int32_t* aNumChildren) {
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(aNumChildren, NS_ERROR_NULL_POINTER);
|
1999-02-08 20:27:42 +03:00
|
|
|
|
|
|
|
*aNumChildren = 0;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t ui = 0;
|
2016-10-24 18:43:49 +03:00
|
|
|
nsresult rv = GetNumberOfUndoItems(&ui);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
1999-02-08 20:27:42 +03:00
|
|
|
|
2016-10-25 08:57:10 +03:00
|
|
|
int32_t ri = 0;
|
2016-10-24 18:43:49 +03:00
|
|
|
rv = GetNumberOfRedoItems(&ri);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
1999-02-08 20:27:42 +03:00
|
|
|
|
|
|
|
*aNumChildren = ui + ri;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::GetChild(int32_t aIndex, TransactionItem** aChild) {
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(aChild, NS_ERROR_NULL_POINTER);
|
2001-03-09 17:23:59 +03:00
|
|
|
|
|
|
|
*aChild = 0;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t numItems = 0;
|
2016-10-24 18:43:49 +03:00
|
|
|
nsresult rv = GetNumberOfChildren(&numItems);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
if (aIndex < 0 || aIndex >= numItems) {
|
2001-03-09 17:23:59 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
2016-10-24 18:43:49 +03:00
|
|
|
}
|
2001-03-09 17:23:59 +03:00
|
|
|
|
|
|
|
// Children are expected to be in the order they were added,
|
|
|
|
// so the child first added would be at the bottom of the undo
|
|
|
|
// stack, or if there are no items on the undo stack, it would
|
|
|
|
// be at the top of the redo stack.
|
2016-10-24 18:43:49 +03:00
|
|
|
rv = GetNumberOfUndoItems(&numItems);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2001-03-09 17:23:59 +03:00
|
|
|
|
|
|
|
if (numItems > 0 && aIndex < numItems) {
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(mUndoStack, NS_ERROR_FAILURE);
|
2001-03-09 17:23:59 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
RefPtr<TransactionItem> child = mUndoStack->GetItem(aIndex);
|
2012-03-03 00:08:40 +04:00
|
|
|
child.forget(aChild);
|
|
|
|
return *aChild ? NS_OK : NS_ERROR_FAILURE;
|
2001-03-09 17:23:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Adjust the index for the redo stack:
|
|
|
|
aIndex -= numItems;
|
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
rv = GetNumberOfRedoItems(&numItems);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(mRedoStack && numItems != 0 && aIndex < numItems,
|
|
|
|
NS_ERROR_FAILURE);
|
2001-03-09 17:23:59 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
RefPtr<TransactionItem> child = mRedoStack->GetItem(aIndex);
|
2012-03-03 00:08:40 +04:00
|
|
|
child.forget(aChild);
|
|
|
|
return *aChild ? NS_OK : NS_ERROR_FAILURE;
|
2001-03-09 17:23:59 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::DoTransaction() {
|
2016-10-24 18:43:49 +03:00
|
|
|
if (mTransaction) {
|
2001-03-09 17:23:59 +03:00
|
|
|
return mTransaction->DoTransaction();
|
2016-10-24 18:43:49 +03:00
|
|
|
}
|
1998-12-01 21:35:49 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::UndoTransaction(
|
|
|
|
TransactionManager* aTransactionManager) {
|
2018-03-22 16:15:54 +03:00
|
|
|
nsresult rv = UndoChildren(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
2018-03-22 16:15:54 +03:00
|
|
|
RecoverFromUndoError(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
return rv;
|
1998-12-05 00:50:09 +03:00
|
|
|
}
|
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
if (!mTransaction) {
|
2010-07-31 21:58:35 +04:00
|
|
|
return NS_OK;
|
2016-10-24 18:43:49 +03:00
|
|
|
}
|
1998-12-05 00:50:09 +03:00
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
rv = mTransaction->UndoTransaction();
|
|
|
|
if (NS_FAILED(rv)) {
|
2018-03-22 16:15:54 +03:00
|
|
|
RecoverFromUndoError(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
return rv;
|
1998-12-05 00:50:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::UndoChildren(
|
|
|
|
TransactionManager* aTransactionManager) {
|
1998-12-01 21:35:49 +03:00
|
|
|
if (mUndoStack) {
|
|
|
|
if (!mRedoStack && mUndoStack) {
|
2018-03-22 17:30:48 +03:00
|
|
|
mRedoStack = new TransactionStack(TransactionStack::FOR_REDO);
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Undo all of the transaction items children! */
|
2016-10-25 08:57:10 +03:00
|
|
|
int32_t sz = mUndoStack->GetSize();
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
nsresult rv = NS_OK;
|
1998-12-01 21:35:49 +03:00
|
|
|
while (sz-- > 0) {
|
2018-03-22 17:07:36 +03:00
|
|
|
RefPtr<TransactionItem> transactionItem = mUndoStack->Peek();
|
|
|
|
if (!transactionItem) {
|
2012-03-03 00:08:40 +04:00
|
|
|
return NS_ERROR_FAILURE;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsCOMPtr<nsITransaction> transaction = transactionItem->GetTransaction();
|
2011-09-29 10:19:26 +04:00
|
|
|
bool doInterrupt = false;
|
2018-03-22 17:07:36 +03:00
|
|
|
rv = aTransactionManager->WillUndoNotify(transaction, &doInterrupt);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
1999-11-11 22:35:40 +03:00
|
|
|
if (doInterrupt) {
|
1999-05-27 01:16:25 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
rv = transactionItem->UndoTransaction(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2018-03-22 17:07:36 +03:00
|
|
|
transactionItem = mUndoStack->Pop();
|
|
|
|
mRedoStack->Push(transactionItem.forget());
|
1999-05-27 01:16:25 +04:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult rv2 = aTransactionManager->DidUndoNotify(transaction, rv);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = rv2;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
}
|
2016-10-24 18:43:49 +03:00
|
|
|
// XXX NS_OK if there is no Undo items or all methods work fine, otherwise,
|
|
|
|
// the result of the last item's UndoTransaction() or
|
|
|
|
// DidUndoNotify() if UndoTransaction() succeeded.
|
|
|
|
return rv;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
return NS_OK;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::RedoTransaction(
|
|
|
|
TransactionManager* aTransactionManager) {
|
2016-07-18 19:36:19 +03:00
|
|
|
nsCOMPtr<nsITransaction> transaction(mTransaction);
|
|
|
|
if (transaction) {
|
2016-10-24 18:43:49 +03:00
|
|
|
nsresult rv = transaction->RedoTransaction();
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
1999-02-04 20:39:21 +03:00
|
|
|
}
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 16:15:54 +03:00
|
|
|
nsresult rv = RedoChildren(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
2018-03-22 16:15:54 +03:00
|
|
|
RecoverFromRedoError(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
return rv;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
1998-12-05 00:50:09 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::RedoChildren(
|
|
|
|
TransactionManager* aTransactionManager) {
|
2016-10-24 18:43:49 +03:00
|
|
|
if (!mRedoStack) {
|
2010-06-19 03:29:16 +04:00
|
|
|
return NS_OK;
|
2016-10-24 18:43:49 +03:00
|
|
|
}
|
1998-12-09 01:05:23 +03:00
|
|
|
|
|
|
|
/* Redo all of the transaction items children! */
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t sz = mRedoStack->GetSize();
|
1998-12-09 01:05:23 +03:00
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
nsresult rv = NS_OK;
|
1998-12-01 21:35:49 +03:00
|
|
|
while (sz-- > 0) {
|
2018-03-22 17:07:36 +03:00
|
|
|
RefPtr<TransactionItem> transactionItem = mRedoStack->Peek();
|
|
|
|
if (!transactionItem) {
|
2012-03-03 00:08:40 +04:00
|
|
|
return NS_ERROR_FAILURE;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsCOMPtr<nsITransaction> transaction = transactionItem->GetTransaction();
|
2011-09-29 10:19:26 +04:00
|
|
|
bool doInterrupt = false;
|
2018-03-22 17:07:36 +03:00
|
|
|
rv = aTransactionManager->WillRedoNotify(transaction, &doInterrupt);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
1999-11-11 22:35:40 +03:00
|
|
|
if (doInterrupt) {
|
1999-05-27 01:16:25 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
rv = transactionItem->RedoTransaction(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2018-03-22 17:07:36 +03:00
|
|
|
transactionItem = mRedoStack->Pop();
|
|
|
|
mUndoStack->Push(transactionItem.forget());
|
1999-05-27 01:16:25 +04:00
|
|
|
}
|
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
// XXX Shouldn't this DidRedoNotify()? (bug 1311626)
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult rv2 = aTransactionManager->DidUndoNotify(transaction, rv);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = rv2;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
}
|
2016-10-24 18:43:49 +03:00
|
|
|
// XXX NS_OK if there is no Redo items or all methods work fine, otherwise,
|
|
|
|
// the result of the last item's RedoTransaction() or
|
|
|
|
// DidUndoNotify() if UndoTransaction() succeeded.
|
|
|
|
return rv;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::GetNumberOfUndoItems(int32_t* aNumItems) {
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(aNumItems, NS_ERROR_NULL_POINTER);
|
1999-02-08 20:27:42 +03:00
|
|
|
|
|
|
|
if (!mUndoStack) {
|
|
|
|
*aNumItems = 0;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-03-03 00:08:40 +04:00
|
|
|
*aNumItems = mUndoStack->GetSize();
|
|
|
|
return *aNumItems ? NS_OK : NS_ERROR_FAILURE;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::GetNumberOfRedoItems(int32_t* aNumItems) {
|
2010-06-18 00:40:48 +04:00
|
|
|
NS_ENSURE_TRUE(aNumItems, NS_ERROR_NULL_POINTER);
|
1999-02-08 20:27:42 +03:00
|
|
|
|
|
|
|
if (!mRedoStack) {
|
|
|
|
*aNumItems = 0;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-03-03 00:08:40 +04:00
|
|
|
*aNumItems = mRedoStack->GetSize();
|
|
|
|
return *aNumItems ? NS_OK : NS_ERROR_FAILURE;
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::RecoverFromUndoError(
|
|
|
|
TransactionManager* aTransactionManager) {
|
1998-12-05 00:50:09 +03:00
|
|
|
// If this method gets called, we never got to the point where we
|
2001-03-09 17:23:59 +03:00
|
|
|
// successfully called UndoTransaction() for the transaction item itself.
|
1998-12-05 00:50:09 +03:00
|
|
|
// Just redo any children that successfully called undo!
|
2018-03-22 16:15:54 +03:00
|
|
|
return RedoChildren(aTransactionManager);
|
1998-12-01 21:35:49 +03:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
nsresult TransactionItem::RecoverFromRedoError(
|
|
|
|
TransactionManager* aTransactionManager) {
|
2001-03-09 17:23:59 +03:00
|
|
|
// If this method gets called, we already successfully called
|
|
|
|
// RedoTransaction() for the transaction item itself. Undo all
|
|
|
|
// the children that successfully called RedoTransaction(),
|
|
|
|
// then undo the transaction item itself.
|
2018-03-22 16:15:54 +03:00
|
|
|
nsresult rv = UndoChildren(aTransactionManager);
|
2016-10-24 18:43:49 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
1998-12-05 00:50:09 +03:00
|
|
|
}
|
|
|
|
|
2016-10-24 18:43:49 +03:00
|
|
|
if (!mTransaction) {
|
2010-08-06 06:13:07 +04:00
|
|
|
return NS_OK;
|
2016-10-24 18:43:49 +03:00
|
|
|
}
|
1998-12-05 00:50:09 +03:00
|
|
|
|
2001-03-09 17:23:59 +03:00
|
|
|
return mTransaction->UndoTransaction();
|
1998-12-05 00:50:09 +03:00
|
|
|
}
|
1998-12-01 21:35:49 +03:00
|
|
|
|
2018-03-22 17:07:36 +03:00
|
|
|
} // namespace mozilla
|