зеркало из https://github.com/mozilla/gecko-dev.git
fix for 125161: forward delete in text widget should not delete trailing blank line
This commit is contained in:
Родитель
6b4239f26f
Коммит
8f022d1476
|
@ -933,6 +933,19 @@ nsTextEditRules::WillDeleteSelection(nsISelection *aSelection,
|
|||
if (NS_FAILED(res)) return res;
|
||||
nextNode = do_QueryInterface(child);
|
||||
}
|
||||
// fix for bugzilla #125161: if we are about to forward delete a <BR>,
|
||||
// make sure it is not last node in editfield. If it is, cancel deletion.
|
||||
if ((aCollapsedAction == nsIEditor::eNext) && nsTextEditUtils::IsBreak(nextNode))
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> lastChild;
|
||||
if (!mBody) return NS_ERROR_NULL_POINTER;
|
||||
res = mBody->GetLastChild(getter_AddRefs(lastChild));
|
||||
if (lastChild == nextNode)
|
||||
{
|
||||
*aCancel = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче