From bc9b8572bb4f2ebac1d6ca31a54e45a801dc1f3e Mon Sep 17 00:00:00 2001 From: "kin%netscape.com" Date: Wed, 18 Jul 2001 21:22:31 +0000 Subject: [PATCH] Fix for bug #90499: Can't delete selection if end of selection contains "
\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 --- editor/base/nsHTMLEditRules.cpp | 1 + editor/libeditor/html/nsHTMLEditRules.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/editor/base/nsHTMLEditRules.cpp b/editor/base/nsHTMLEditRules.cpp index f3ed75365f6..2282275359d 100644 --- a/editor/base/nsHTMLEditRules.cpp +++ b/editor/base/nsHTMLEditRules.cpp @@ -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); diff --git a/editor/libeditor/html/nsHTMLEditRules.cpp b/editor/libeditor/html/nsHTMLEditRules.cpp index f3ed75365f6..2282275359d 100644 --- a/editor/libeditor/html/nsHTMLEditRules.cpp +++ b/editor/libeditor/html/nsHTMLEditRules.cpp @@ -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);