зеркало из https://github.com/mozilla/gecko-dev.git
fix for bug 20205: selection was getting jerked around by whitespace conversion code.
This commit is contained in:
Родитель
680a88820a
Коммит
f5c7841eae
|
@ -209,7 +209,7 @@ nsHTMLEditRules::DidDoAction(nsIDOMSelection *aSelection,
|
|||
// adjust whitespace for insert text and delete actions
|
||||
if ((aInfo->action == kInsertText) || (aInfo->action == kDeleteSelection))
|
||||
{
|
||||
res = AdjustWhitespace();
|
||||
res = AdjustWhitespace(aSelection);
|
||||
if (NS_FAILED(res)) return res;
|
||||
}
|
||||
// clean up any empty nodes in the selection
|
||||
|
@ -3488,13 +3488,15 @@ nsHTMLEditRules::AdjustSpecialBreaks()
|
|||
|
||||
|
||||
nsresult
|
||||
nsHTMLEditRules::AdjustWhitespace()
|
||||
nsHTMLEditRules::AdjustWhitespace(nsIDOMSelection *aSelection)
|
||||
{
|
||||
nsCOMPtr<nsIContentIterator> iter;
|
||||
nsCOMPtr<nsISupportsArray> arrayOfNodes;
|
||||
nsCOMPtr<nsISupports> isupports;
|
||||
PRUint32 nodeCount,j;
|
||||
nsresult res;
|
||||
|
||||
nsAutoSelectionReset selectionResetter(aSelection);
|
||||
|
||||
// special case for mDocChangeRange entirely in one text node.
|
||||
// This is an efficiency hack for normal typing in the editor.
|
||||
|
|
|
@ -143,7 +143,7 @@ protected:
|
|||
nsresult PopListItem(nsIDOMNode *aListItem, PRBool *aOutOfList);
|
||||
|
||||
nsresult AdjustSpecialBreaks();
|
||||
nsresult AdjustWhitespace();
|
||||
nsresult AdjustWhitespace(nsIDOMSelection *aSelection);
|
||||
nsresult AdjustSelection(nsIDOMSelection *aSelection, nsIEditor::ESelectionCollapseDirection aAction);
|
||||
nsresult RemoveEmptyNodes();
|
||||
nsresult DoTextNodeWhitespace(nsIDOMCharacterData *aTextNode, PRInt32 aStart, PRInt32 aEnd);
|
||||
|
|
|
@ -209,7 +209,7 @@ nsHTMLEditRules::DidDoAction(nsIDOMSelection *aSelection,
|
|||
// adjust whitespace for insert text and delete actions
|
||||
if ((aInfo->action == kInsertText) || (aInfo->action == kDeleteSelection))
|
||||
{
|
||||
res = AdjustWhitespace();
|
||||
res = AdjustWhitespace(aSelection);
|
||||
if (NS_FAILED(res)) return res;
|
||||
}
|
||||
// clean up any empty nodes in the selection
|
||||
|
@ -3488,13 +3488,15 @@ nsHTMLEditRules::AdjustSpecialBreaks()
|
|||
|
||||
|
||||
nsresult
|
||||
nsHTMLEditRules::AdjustWhitespace()
|
||||
nsHTMLEditRules::AdjustWhitespace(nsIDOMSelection *aSelection)
|
||||
{
|
||||
nsCOMPtr<nsIContentIterator> iter;
|
||||
nsCOMPtr<nsISupportsArray> arrayOfNodes;
|
||||
nsCOMPtr<nsISupports> isupports;
|
||||
PRUint32 nodeCount,j;
|
||||
nsresult res;
|
||||
|
||||
nsAutoSelectionReset selectionResetter(aSelection);
|
||||
|
||||
// special case for mDocChangeRange entirely in one text node.
|
||||
// This is an efficiency hack for normal typing in the editor.
|
||||
|
|
|
@ -143,7 +143,7 @@ protected:
|
|||
nsresult PopListItem(nsIDOMNode *aListItem, PRBool *aOutOfList);
|
||||
|
||||
nsresult AdjustSpecialBreaks();
|
||||
nsresult AdjustWhitespace();
|
||||
nsresult AdjustWhitespace(nsIDOMSelection *aSelection);
|
||||
nsresult AdjustSelection(nsIDOMSelection *aSelection, nsIEditor::ESelectionCollapseDirection aAction);
|
||||
nsresult RemoveEmptyNodes();
|
||||
nsresult DoTextNodeWhitespace(nsIDOMCharacterData *aTextNode, PRInt32 aStart, PRInt32 aEnd);
|
||||
|
|
Загрузка…
Ссылка в новой задаче