mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
fix for 125161: forward delete in text widget should not delete trailing blank line
This commit is contained in:
parent
6b4239f26f
commit
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user