зеркало из https://github.com/mozilla/pjs.git
api change to include event (similar to paste/drop hook); r=cmanske, sr=sfraser, a=asa bug=203365
This commit is contained in:
Родитель
92e98db7c0
Коммит
376c526961
|
@ -314,7 +314,7 @@ nsresult nsCopySupport::DoHooks(nsIDocument *aDoc, nsITransferable *aTrans,
|
|||
override = do_QueryInterface(isupp);
|
||||
if (override)
|
||||
{
|
||||
nsresult hookResult = override->OnCopyOrDrag(aTrans, aDoPutOnClipboard);
|
||||
nsresult hookResult = override->OnCopyOrDrag(nsnull, aTrans, aDoPutOnClipboard);
|
||||
NS_ASSERTION(NS_SUCCEEDED(hookResult), "OnCopyOrDrag hook failed");
|
||||
if (!*aDoPutOnClipboard)
|
||||
break;
|
||||
|
|
|
@ -297,7 +297,8 @@ nsEditorHookUtils::DoAllowDragHook(nsIDOMDocument *aDoc, nsIDOMEvent *aDragEvent
|
|||
}
|
||||
|
||||
PRBool
|
||||
nsEditorHookUtils::DoDragHook(nsIDOMDocument *aDoc, nsITransferable *aTrans)
|
||||
nsEditorHookUtils::DoDragHook(nsIDOMDocument *aDoc, nsIDOMEvent *aEvent,
|
||||
nsITransferable *aTrans)
|
||||
{
|
||||
nsCOMPtr<nsISimpleEnumerator> enumerator;
|
||||
GetHookEnumeratorFromDocument(aDoc, getter_AddRefs(enumerator));
|
||||
|
@ -315,7 +316,7 @@ nsEditorHookUtils::DoDragHook(nsIDOMDocument *aDoc, nsITransferable *aTrans)
|
|||
if (override)
|
||||
{
|
||||
PRBool canInvokeDrag = PR_TRUE;
|
||||
nsresult hookResult = override->OnCopyOrDrag(aTrans, &canInvokeDrag);
|
||||
nsresult hookResult = override->OnCopyOrDrag(aEvent, aTrans, &canInvokeDrag);
|
||||
NS_ASSERTION(NS_SUCCEEDED(hookResult), "hook failure in OnCopyOrDrag");
|
||||
if (!canInvokeDrag)
|
||||
return PR_FALSE;
|
||||
|
|
|
@ -276,7 +276,8 @@ class nsEditorHookUtils
|
|||
{
|
||||
public:
|
||||
static PRBool DoAllowDragHook(nsIDOMDocument *aDoc, nsIDOMEvent *aEvent);
|
||||
static PRBool DoDragHook(nsIDOMDocument *aDoc, nsITransferable *aTrans);
|
||||
static PRBool DoDragHook(nsIDOMDocument *aDoc, nsIDOMEvent *aEvent,
|
||||
nsITransferable *aTrans);
|
||||
static PRBool DoAllowDropHook(nsIDOMDocument *aDoc, nsIDOMEvent *aEvent,
|
||||
nsIDragSession *aSession);
|
||||
static PRBool DoInsertionHook(nsIDOMDocument *aDoc, nsIDOMEvent *aEvent,
|
||||
|
|
|
@ -403,7 +403,7 @@ NS_IMETHODIMP nsPlaintextEditor::DoDrag(nsIDOMEvent *aDragEvent)
|
|||
// check our transferable hooks (if any)
|
||||
nsCOMPtr<nsIDOMDocument> domdoc;
|
||||
GetDocument(getter_AddRefs(domdoc));
|
||||
if (!nsEditorHookUtils::DoDragHook(domdoc, trans))
|
||||
if (!nsEditorHookUtils::DoDragHook(domdoc, aDragEvent, trans))
|
||||
return NS_OK;
|
||||
|
||||
/* invoke drag */
|
||||
|
|
|
@ -314,7 +314,7 @@ nsresult nsCopySupport::DoHooks(nsIDocument *aDoc, nsITransferable *aTrans,
|
|||
override = do_QueryInterface(isupp);
|
||||
if (override)
|
||||
{
|
||||
nsresult hookResult = override->OnCopyOrDrag(aTrans, aDoPutOnClipboard);
|
||||
nsresult hookResult = override->OnCopyOrDrag(nsnull, aTrans, aDoPutOnClipboard);
|
||||
NS_ASSERTION(NS_SUCCEEDED(hookResult), "OnCopyOrDrag hook failed");
|
||||
if (!*aDoPutOnClipboard)
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче