fixed selection results after bold/italics. 4593 bug. simply collapsed range and extended it to take up the whole new range

git-svn-id: svn://10.0.0.236/trunk@26771 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com 1999-04-08 01:30:05 +00:00
parent 3f9c7d2ca8
commit af245251eb

View File

@ -1053,6 +1053,15 @@ NS_IMETHODIMP nsTextEditor::SetTextPropertiesForNode(nsIDOMNode *aNode,
result = nsEditor::DeleteNode(newTextNode);
if (NS_SUCCEEDED(result)) {
result = nsEditor::InsertNode(newTextNode, newStyleNode, 0);
if (NS_SUCCEEDED(result)) {
nsCOMPtr<nsIDOMSelection>selection;
result = nsEditor::GetSelection(getter_AddRefs(selection));
if (NS_SUCCEEDED(result)) {
selection->Collapse(newTextNode, 0);
PRInt32 endOffset = aEndOffset-aStartOffset;
selection->Extend(newTextNode, endOffset);
}
}
}
}
}