bug 179621: Inspector should use Editor's TransactionManager model: Phase One amendment patch

patch by Alex Vincent <ajvincent@gmail.com> r=timeless sr=roc
This commit is contained in:
cbiesinger%web.de 2004-11-27 20:20:10 +00:00
parent e0e44d1781
commit 0375dee12c

View File

@ -147,31 +147,23 @@ function nodeTypeToText (nodeType)
return nodeType;
}
// Functions for converting Inspector-style command constructors to nsITransaction constructors
function ConvertCommandToTxn(constructor) {
constructor.prototype.doTransaction = constructor.prototype.doCommand;
constructor.prototype.undoTransaction = constructor.prototype.undoCommand;
constructor.prototype.redoTransaction = constructor.prototype.doCommand;
constructor.prototype.merge = ConvertCommandToTxn.txnMerge;
constructor.prototype.QueryInterface = ConvertCommandToTxn.txnQueryInterface;
// ::::::: nsITransaction helper functions :::::::
if (arguments.length > 1) {
constructor.prototype.txnType = arguments[1];
} else {
constructor.prototype.txnType = "standard";
}
if (arguments.length > 2) {
constructor.prototype.isTransient = arguments[2];
} else {
constructor.prototype.isTransient = false;
}
}
ConvertCommandToTxn.txnQueryInterface = function(theUID, theResult) {
if (theUID == Components.interfaces.nsITransaction || theUID == Components.interfaces.nsISupports) {
function txnQueryInterface(theUID, theResult)
{
const nsITransaction = Components.interfaces.nsITransaction;
const nsISupports = Components.interfaces.nsISupports;
if (theUID == nsITransaction || theUID == nsISupports) {
return this;
}
return null;
}
ConvertCommandToTxn.txnMerge = function() {
function txnMerge()
{
return false;
}
function txnRedoTransaction() {
this.doTransaction();
}