Bug 551704 - Part 2: Don't replace newline characters with BR nodes in preformatted editable fields; r=roc a=blocking-betaN+

This commit is contained in:
Ehsan Akhgari
2010-11-06 18:49:26 -04:00
parent 666cd09db0
commit f940e69416
5 changed files with 36 additions and 122 deletions

View File

@@ -484,22 +484,7 @@ nsHTMLEditRules::AfterEditInner(PRInt32 action, nsIEditor::EDirection aDirection
res = mHTMLEditor->CollapseAdjacentTextNodes(mDocChangeRange);
NS_ENSURE_SUCCESS(res, res);
}
// replace newlines with breaks.
// MOOSE: This is buttUgly. A better way to
// organize the action enum is in order.
if (// (action == nsEditor::kOpInsertText) ||
// (action == nsEditor::kOpInsertIMEText) ||
(action == nsHTMLEditor::kOpInsertElement) ||
(action == nsHTMLEditor::kOpInsertQuotation) ||
(action == nsEditor::kOpInsertNode) ||
(action == nsHTMLEditor::kOpHTMLPaste ||
(action == nsHTMLEditor::kOpLoadHTML)))
{
res = ReplaceNewlines(mDocChangeRange);
NS_ENSURE_SUCCESS(res, res);
}
// clean up any empty nodes in the selection
res = RemoveEmptyNodes();
NS_ENSURE_SUCCESS(res, res);