mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 13:45:46 +00:00
InsertBreak now works at the beginning of a line. Plus a trivial bug fix.
This commit is contained in:
parent
f216949dfc
commit
458de90002
@ -1235,7 +1235,7 @@ NS_IMETHODIMP nsEditor::DeleteSelectionAndCreateNode(const nsString& aTag, nsIDO
|
||||
}
|
||||
}
|
||||
else {
|
||||
offsetOfNewNode = selectedNodeContentCount;
|
||||
offsetOfNewNode = offsetOfSelectedNode;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(result))
|
||||
|
@ -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<nsIDOMNode> rightNode;
|
||||
result = prevNode->GetNextSibling(getter_AddRefs(rightNode));
|
||||
result = nextNode->GetNextSibling(getter_AddRefs(rightNode));
|
||||
if ((NS_SUCCEEDED(result)) && rightNode)
|
||||
{
|
||||
if (PR_TRUE==NodeIsType(rightNode, brTag))
|
||||
|
@ -1235,7 +1235,7 @@ NS_IMETHODIMP nsEditor::DeleteSelectionAndCreateNode(const nsString& aTag, nsIDO
|
||||
}
|
||||
}
|
||||
else {
|
||||
offsetOfNewNode = selectedNodeContentCount;
|
||||
offsetOfNewNode = offsetOfSelectedNode;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(result))
|
||||
|
@ -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<nsIDOMNode> rightNode;
|
||||
result = prevNode->GetNextSibling(getter_AddRefs(rightNode));
|
||||
result = nextNode->GetNextSibling(getter_AddRefs(rightNode));
|
||||
if ((NS_SUCCEEDED(result)) && rightNode)
|
||||
{
|
||||
if (PR_TRUE==NodeIsType(rightNode, brTag))
|
||||
|
Loading…
x
Reference in New Issue
Block a user