зеркало из https://github.com/mozilla/gecko-dev.git
Bug 286804 Newline improperly getting into single-line edit field. r=timeless, sr=neil.parkwaycc.co.uk
This commit is contained in:
Родитель
c9f843ab67
Коммит
83809fc251
|
@ -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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче