fix for bug 20205: selection was getting jerked around by whitespace conversion code.

This commit is contained in:
jfrancis%netscape.com 1999-11-30 21:58:37 +00:00
Родитель 680a88820a
Коммит f5c7841eae
4 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -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);