mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 610378, initialize effectAllowed properly for external drags, r=smaug,a=bsmedberg
This commit is contained in:
parent
fd894fdd5f
commit
0cc69e24ed
@ -4945,12 +4945,9 @@ nsContentUtils::SetDataTransferInEvent(nsDragEvent* aDragEvent)
|
||||
// A dataTransfer won't exist when a drag was started by some other
|
||||
// means, for instance calling the drag service directly, or a drag
|
||||
// from another application. In either case, a new dataTransfer should
|
||||
// be created that reflects the data. Pass true to the constructor for
|
||||
// the aIsExternal argument, so that only system access is allowed.
|
||||
PRUint32 action = 0;
|
||||
dragSession->GetDragAction(&action);
|
||||
// be created that reflects the data.
|
||||
initialDataTransfer =
|
||||
new nsDOMDataTransfer(aDragEvent->message, action);
|
||||
new nsDOMDataTransfer(aDragEvent->message);
|
||||
NS_ENSURE_TRUE(initialDataTransfer, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
// now set it in the drag session so we don't need to create it again
|
||||
|
@ -84,9 +84,10 @@ nsDOMDataTransfer::nsDOMDataTransfer()
|
||||
{
|
||||
}
|
||||
|
||||
nsDOMDataTransfer::nsDOMDataTransfer(PRUint32 aEventType, PRUint32 aAction)
|
||||
nsDOMDataTransfer::nsDOMDataTransfer(PRUint32 aEventType)
|
||||
: mEventType(aEventType),
|
||||
mDropEffect(nsIDragService::DRAGDROP_ACTION_NONE),
|
||||
mEffectAllowed(nsIDragService::DRAGDROP_ACTION_UNINITIALIZED),
|
||||
mCursorState(PR_FALSE),
|
||||
mReadOnly(PR_TRUE),
|
||||
mIsExternal(PR_TRUE),
|
||||
@ -94,11 +95,6 @@ nsDOMDataTransfer::nsDOMDataTransfer(PRUint32 aEventType, PRUint32 aAction)
|
||||
mDragImageX(0),
|
||||
mDragImageY(0)
|
||||
{
|
||||
mEffectAllowed = aAction &
|
||||
(nsIDragService::DRAGDROP_ACTION_COPY |
|
||||
nsIDragService::DRAGDROP_ACTION_LINK |
|
||||
nsIDragService::DRAGDROP_ACTION_MOVE);
|
||||
|
||||
CacheExternalFormats();
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ protected:
|
||||
// that was started without using a data transfer, either an external drag,
|
||||
// that is, a drag where the source is another application, or a drag
|
||||
// started by calling the drag service directly.
|
||||
nsDOMDataTransfer(PRUint32 aEventType, PRUint32 aAction);
|
||||
nsDOMDataTransfer(PRUint32 aEventType);
|
||||
|
||||
// this constructor is used only by the Clone method to copy the fields as
|
||||
// needed to a new data transfer.
|
||||
|
Loading…
Reference in New Issue
Block a user