some extremely minor cleanup of bugs found by ftang. Thanks, frank.

git-svn-id: svn://10.0.0.236/trunk@51036 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
buster%netscape.com
1999-10-18 21:59:19 +00:00
parent b931259907
commit a8ec8337df
2 changed files with 14 additions and 8 deletions

View File

@@ -167,7 +167,8 @@ NS_IMETHODIMP CreateElementTxn::Undo(void)
PRInt32 offset=0;
if (mRefNode) {
nsEditor::GetChildOffset(mRefNode, mParent, offset);
result = nsEditor::GetChildOffset(mRefNode, mParent, offset);
if (NS_FAILED(result)) return result;
}
result = selection->Collapse(mParent, offset);
NS_ASSERTION((NS_SUCCEEDED(result)), "selection could not be collapsed after undo of insert.");
@@ -200,9 +201,11 @@ NS_IMETHODIMP CreateElementTxn::Redo(void)
if (NS_FAILED(result)) return result;
if (!selection) return NS_ERROR_NULL_POINTER;
PRInt32 offset=0;
nsEditor::GetChildOffset(mNewNode, mParent, offset);
result = selection->Collapse(mParent, offset);
NS_ASSERTION((NS_SUCCEEDED(result)), "selection could not be collapsed after undo of insert.");
result = nsEditor::GetChildOffset(mNewNode, mParent, offset);
if (NS_FAILED(result)) return result;
result = selection->Collapse(mParent, offset+1);
NS_ASSERTION((NS_SUCCEEDED(result)), "selection could not be collapsed after redo of insert.");
}
return result;
}