Bug 286804 Newline improperly getting into single-line edit field. r=timeless, sr=neil.parkwaycc.co.uk

This commit is contained in:
masayuki%d-toybox.com 2005-03-25 16:37:14 +00:00
Родитель c9f843ab67
Коммит 83809fc251
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -592,8 +592,18 @@ nsTextEditRules::WillInsertText(PRInt32 aAction,
else if (singleLineNewlineBehavior == ePasteFirstLine)
{
PRInt32 firstCRLF = tString.FindCharInSet(CRLF);
// we get first *non-empty* line.
PRInt32 offset = 0;
while (firstCRLF == offset)
{
offset++;
firstCRLF = tString.FindCharInSet(CRLF, offset);
}
if (firstCRLF > 0)
tString.Truncate(firstCRLF);
if (offset > 0)
tString.Cut(0, offset);
}
else if (singleLineNewlineBehavior == eReplaceWithCommas)
{