mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 11:58:55 +00:00
fixed a small bug. mRefNode may be nsnull.
This commit is contained in:
parent
6f4ea05832
commit
9450d290ae
@ -142,7 +142,9 @@ NS_IMETHODIMP CreateElementTxn::Undo(void)
|
||||
nsresult selectionResult = mEditor->GetSelection(getter_AddRefs(selection));
|
||||
if (NS_SUCCEEDED(selectionResult) && selection) {
|
||||
PRInt32 offset=0;
|
||||
nsIEditorSupport::GetChildOffset(mRefNode, mParent, offset);
|
||||
if (mRefNode) {
|
||||
nsIEditorSupport::GetChildOffset(mRefNode, mParent, offset);
|
||||
}
|
||||
selectionResult = selection->Collapse(mParent, offset);
|
||||
NS_ASSERTION((NS_SUCCEEDED(selectionResult)), "selection could not be collapsed after undo of insert.");
|
||||
}
|
||||
|
@ -142,7 +142,9 @@ NS_IMETHODIMP CreateElementTxn::Undo(void)
|
||||
nsresult selectionResult = mEditor->GetSelection(getter_AddRefs(selection));
|
||||
if (NS_SUCCEEDED(selectionResult) && selection) {
|
||||
PRInt32 offset=0;
|
||||
nsIEditorSupport::GetChildOffset(mRefNode, mParent, offset);
|
||||
if (mRefNode) {
|
||||
nsIEditorSupport::GetChildOffset(mRefNode, mParent, offset);
|
||||
}
|
||||
selectionResult = selection->Collapse(mParent, offset);
|
||||
NS_ASSERTION((NS_SUCCEEDED(selectionResult)), "selection could not be collapsed after undo of insert.");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user