mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
fixed an uninitialized pointer problem
ctrl-ins appends an HR to the BODY
This commit is contained in:
parent
27b37e6ffc
commit
196f38742c
@ -38,6 +38,7 @@ CreateElementTxn::CreateElementTxn(nsEditor *aEditor,
|
||||
NS_ADDREF(mParent);
|
||||
mOffsetInParent = aOffsetInParent;
|
||||
mNewNode = nsnull;
|
||||
mRefNode = nsnull;
|
||||
}
|
||||
|
||||
CreateElementTxn::~CreateElementTxn()
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ CreateElementTxn::CreateElementTxn(nsEditor *aEditor,
|
||||
NS_ADDREF(mParent);
|
||||
mOffsetInParent = aOffsetInParent;
|
||||
mNewNode = nsnull;
|
||||
mRefNode = nsnull;
|
||||
}
|
||||
|
||||
CreateElementTxn::~CreateElementTxn()
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ CreateElementTxn::CreateElementTxn(nsEditor *aEditor,
|
||||
NS_ADDREF(mParent);
|
||||
mOffsetInParent = aOffsetInParent;
|
||||
mNewNode = nsnull;
|
||||
mRefNode = nsnull;
|
||||
}
|
||||
|
||||
CreateElementTxn::~CreateElementTxn()
|
||||
|
Loading…
x
Reference in New Issue
Block a user