Fix for bug #90499: Can't delete selection if end of selection contains "<br>\n"

Modified nsHTMLEditRules::WillDeleteSelection() so that it uses
an nsAutoTxnsConserveSelection auto-variable to prevent the
call to nsWSRunObject::PrepareToDeleteRange() from changing
the selection.

r=brade@netscape.com  sr=waterson@netscape.com
This commit is contained in:
kin%netscape.com 2001-07-18 21:22:31 +00:00
parent 379318d631
commit 45c8f49930
2 changed files with 2 additions and 0 deletions

View File

@ -1847,6 +1847,7 @@ nsHTMLEditRules::WillDeleteSelection(nsISelection *aSelection,
// adjust surrounding whitespace in preperation to delete selection
if (!bPlaintext)
{
nsAutoTxnsConserveSelection dontSpazMySelection(mHTMLEditor);
res = nsWSRunObject::PrepareToDeleteRange(mHTMLEditor,
address_of(startNode), &startOffset,
address_of(endNode), &endOffset);

View File

@ -1847,6 +1847,7 @@ nsHTMLEditRules::WillDeleteSelection(nsISelection *aSelection,
// adjust surrounding whitespace in preperation to delete selection
if (!bPlaintext)
{
nsAutoTxnsConserveSelection dontSpazMySelection(mHTMLEditor);
res = nsWSRunObject::PrepareToDeleteRange(mHTMLEditor,
address_of(startNode), &startOffset,
address_of(endNode), &endOffset);