changed nsIEditor to enable undo separately from Init
work in progress API changes to nsIEditor and nsEditor git-svn-id: svn://10.0.0.236/trunk@18914 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
#include "SplitElementTxn.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "editor.h"
|
||||
|
||||
// note that aEditor is not refcounted
|
||||
SplitElementTxn::SplitElementTxn()
|
||||
@@ -27,9 +26,11 @@ SplitElementTxn::SplitElementTxn()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult SplitElementTxn::Init(nsIDOMNode *aNode,
|
||||
nsresult SplitElementTxn::Init(nsIEditor *aEditor,
|
||||
nsIDOMNode *aNode,
|
||||
PRInt32 aOffset)
|
||||
{
|
||||
mEditor = aEditor;
|
||||
mExistingRightNode = aNode;
|
||||
mOffset = aOffset;
|
||||
return NS_OK;
|
||||
@@ -52,7 +53,7 @@ nsresult SplitElementTxn::Do(void)
|
||||
// insert the new node
|
||||
if ((NS_SUCCEEDED(result)) && (mParent))
|
||||
{
|
||||
result = nsEditor::SplitNode(mExistingRightNode, mOffset, mNewLeftNode, mParent);
|
||||
result = mEditor->SplitNode(mExistingRightNode, mOffset, mNewLeftNode, mParent);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -61,13 +62,13 @@ nsresult SplitElementTxn::Do(void)
|
||||
nsresult SplitElementTxn::Undo(void)
|
||||
{
|
||||
// this assumes Do inserted the new node in front of the prior existing node
|
||||
nsresult result = nsEditor::JoinNodes(mExistingRightNode, mNewLeftNode, mParent, PR_FALSE);
|
||||
nsresult result = mEditor->JoinNodes(mExistingRightNode, mNewLeftNode, mParent, PR_FALSE);
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult SplitElementTxn::Redo(void)
|
||||
{
|
||||
nsresult result = nsEditor::SplitNode(mExistingRightNode, mOffset, mNewLeftNode, mParent);
|
||||
nsresult result = mEditor->SplitNode(mExistingRightNode, mOffset, mNewLeftNode, mParent);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user