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:
Markus Stange 2010-03-08 13:32:53 +01:00
Родитель c0d4f5f49d
Коммит bd77ea9088
1 изменённых файлов: 3 добавлений и 14 удалений

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

@ -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
{