fixed an uninitialized pointer problem

ctrl-ins appends an HR to the BODY
This commit is contained in:
buster%netscape.com 1999-01-08 01:41:34 +00:00
parent 27b37e6ffc
commit 196f38742c
5 changed files with 15 additions and 2 deletions

View File

@ -38,6 +38,7 @@ CreateElementTxn::CreateElementTxn(nsEditor *aEditor,
NS_ADDREF(mParent);
mOffsetInParent = aOffsetInParent;
mNewNode = nsnull;
mRefNode = nsnull;
}
CreateElementTxn::~CreateElementTxn()

View File

@ -304,8 +304,13 @@ nsEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aProces
result = mEditor->GetDomInterface(&doc);
if (NS_SUCCEEDED(result))
{
PRUint32 position=0;
if (PR_TRUE==ctrlKey)
position=CreateElementTxn::eAppend;
else
position=0;
CreateElementTxn *txn;
txn = new CreateElementTxn(mEditor, doc, imgTag, currentNode, 0);
txn = new CreateElementTxn(mEditor, doc, imgTag, currentNode, position);
mEditor->ExecuteTransaction(txn);
}
}

View File

@ -38,6 +38,7 @@ CreateElementTxn::CreateElementTxn(nsEditor *aEditor,
NS_ADDREF(mParent);
mOffsetInParent = aOffsetInParent;
mNewNode = nsnull;
mRefNode = nsnull;
}
CreateElementTxn::~CreateElementTxn()

View File

@ -304,8 +304,13 @@ nsEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aProces
result = mEditor->GetDomInterface(&doc);
if (NS_SUCCEEDED(result))
{
PRUint32 position=0;
if (PR_TRUE==ctrlKey)
position=CreateElementTxn::eAppend;
else
position=0;
CreateElementTxn *txn;
txn = new CreateElementTxn(mEditor, doc, imgTag, currentNode, 0);
txn = new CreateElementTxn(mEditor, doc, imgTag, currentNode, position);
mEditor->ExecuteTransaction(txn);
}
}

View File

@ -38,6 +38,7 @@ CreateElementTxn::CreateElementTxn(nsEditor *aEditor,
NS_ADDREF(mParent);
mOffsetInParent = aOffsetInParent;
mNewNode = nsnull;
mRefNode = nsnull;
}
CreateElementTxn::~CreateElementTxn()