зеркало из https://github.com/mozilla/gecko-dev.git
Bug 434210 - When dropping text in textfields, check the drag session's drag action instead of the event's modifier flags when determining whether to move or copy text. r=smaug
This commit is contained in:
Родитель
c0d4f5f49d
Коммит
bd77ea9088
|
@ -255,20 +255,9 @@ NS_IMETHODIMP nsPlaintextEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
|
|||
if (srcdomdoc == destdomdoc)
|
||||
{
|
||||
// Within the same doc: delete if user doesn't want to copy
|
||||
|
||||
// check if the user pressed the key to force a copy rather than a move
|
||||
// if we run into problems here, we'll just assume the user doesn't want a copy
|
||||
PRBool userWantsCopy = PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouseEvent ( do_QueryInterface(aDropEvent) );
|
||||
if (mouseEvent)
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
mouseEvent->GetAltKey(&userWantsCopy);
|
||||
#else
|
||||
mouseEvent->GetCtrlKey(&userWantsCopy);
|
||||
#endif
|
||||
|
||||
deleteSelection = !userWantsCopy;
|
||||
PRUint32 action;
|
||||
dragSession->GetDragAction(&action);
|
||||
deleteSelection = !(action & nsIDragService::DRAGDROP_ACTION_COPY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче