From 458de900023c2b5f1c115db49f9935f0917458df Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Sat, 13 Mar 1999 05:31:22 +0000 Subject: [PATCH] InsertBreak now works at the beginning of a line. Plus a trivial bug fix. --- editor/base/nsEditor.cpp | 2 +- editor/base/nsTextEditRules.cpp | 2 +- editor/libeditor/base/nsEditor.cpp | 2 +- editor/libeditor/text/nsTextEditRules.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/base/nsEditor.cpp b/editor/base/nsEditor.cpp index d57c879d822d..c7c2b822a9bb 100644 --- a/editor/base/nsEditor.cpp +++ b/editor/base/nsEditor.cpp @@ -1235,7 +1235,7 @@ NS_IMETHODIMP nsEditor::DeleteSelectionAndCreateNode(const nsString& aTag, nsIDO } } else { - offsetOfNewNode = selectedNodeContentCount; + offsetOfNewNode = offsetOfSelectedNode; } if (NS_SUCCEEDED(result)) diff --git a/editor/base/nsTextEditRules.cpp b/editor/base/nsTextEditRules.cpp index 817dbcade619..8a1accd50169 100644 --- a/editor/base/nsTextEditRules.cpp +++ b/editor/base/nsTextEditRules.cpp @@ -270,7 +270,7 @@ nsTextEditRules::DidInsertBreak(nsIDOMSelection *aSelection, nsresult aResult) if (PR_TRUE==NodeIsType(nextNode, brTag)) { // the previous node is a BR, check it's siblings nsCOMPtr rightNode; - result = prevNode->GetNextSibling(getter_AddRefs(rightNode)); + result = nextNode->GetNextSibling(getter_AddRefs(rightNode)); if ((NS_SUCCEEDED(result)) && rightNode) { if (PR_TRUE==NodeIsType(rightNode, brTag)) diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index d57c879d822d..c7c2b822a9bb 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -1235,7 +1235,7 @@ NS_IMETHODIMP nsEditor::DeleteSelectionAndCreateNode(const nsString& aTag, nsIDO } } else { - offsetOfNewNode = selectedNodeContentCount; + offsetOfNewNode = offsetOfSelectedNode; } if (NS_SUCCEEDED(result)) diff --git a/editor/libeditor/text/nsTextEditRules.cpp b/editor/libeditor/text/nsTextEditRules.cpp index 817dbcade619..8a1accd50169 100644 --- a/editor/libeditor/text/nsTextEditRules.cpp +++ b/editor/libeditor/text/nsTextEditRules.cpp @@ -270,7 +270,7 @@ nsTextEditRules::DidInsertBreak(nsIDOMSelection *aSelection, nsresult aResult) if (PR_TRUE==NodeIsType(nextNode, brTag)) { // the previous node is a BR, check it's siblings nsCOMPtr rightNode; - result = prevNode->GetNextSibling(getter_AddRefs(rightNode)); + result = nextNode->GetNextSibling(getter_AddRefs(rightNode)); if ((NS_SUCCEEDED(result)) && rightNode) { if (PR_TRUE==NodeIsType(rightNode, brTag))