зеркало из https://github.com/mozilla/gecko-dev.git
landing jfrancis fix for 67109 - Drag and drop to and from textfields is broken
sr=kin r=anthonyd
This commit is contained in:
Родитель
b66f7a9e59
Коммит
e177704f0e
|
@ -21,7 +21,6 @@
|
|||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsEditorEventListeners.h"
|
||||
#include "nsIHTMLEditor.h"
|
||||
#include "nsEditor.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsString.h"
|
||||
|
@ -611,14 +610,13 @@ nsresult
|
|||
nsTextEditorDragListener::DragGesture(nsIDOMEvent* aDragEvent)
|
||||
{
|
||||
PRBool canDrag = PR_FALSE;
|
||||
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
|
||||
if ( !htmlEditor )
|
||||
if ( !mEditor )
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
// ...figure out if a drag should be started...
|
||||
nsresult rv = htmlEditor->CanDrag(aDragEvent, canDrag);
|
||||
nsresult rv = mEditor->CanDrag(aDragEvent, canDrag);
|
||||
if ( NS_SUCCEEDED(rv) && canDrag )
|
||||
rv = htmlEditor->DoDrag(aDragEvent);
|
||||
rv = mEditor->DoDrag(aDragEvent);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -677,8 +675,7 @@ nsTextEditorDragListener::DragExit(nsIDOMEvent* aDragEvent)
|
|||
nsresult
|
||||
nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
|
||||
if ( htmlEditor )
|
||||
if ( mEditor )
|
||||
{
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv);
|
||||
|
@ -764,7 +761,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
|||
}
|
||||
}
|
||||
// if we are not over orginal selection, drop that baby!
|
||||
return htmlEditor->InsertFromDrop(aMouseEvent);
|
||||
return mEditor->InsertFromDrop(aMouseEvent);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
*/
|
||||
#include "nsEditorEventListeners.h"
|
||||
#include "nsIHTMLEditor.h"
|
||||
#include "nsEditor.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsString.h"
|
||||
|
@ -611,14 +610,13 @@ nsresult
|
|||
nsTextEditorDragListener::DragGesture(nsIDOMEvent* aDragEvent)
|
||||
{
|
||||
PRBool canDrag = PR_FALSE;
|
||||
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
|
||||
if ( !htmlEditor )
|
||||
if ( !mEditor )
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
// ...figure out if a drag should be started...
|
||||
nsresult rv = htmlEditor->CanDrag(aDragEvent, canDrag);
|
||||
nsresult rv = mEditor->CanDrag(aDragEvent, canDrag);
|
||||
if ( NS_SUCCEEDED(rv) && canDrag )
|
||||
rv = htmlEditor->DoDrag(aDragEvent);
|
||||
rv = mEditor->DoDrag(aDragEvent);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -677,8 +675,7 @@ nsTextEditorDragListener::DragExit(nsIDOMEvent* aDragEvent)
|
|||
nsresult
|
||||
nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
|
||||
if ( htmlEditor )
|
||||
if ( mEditor )
|
||||
{
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv);
|
||||
|
@ -764,7 +761,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
|||
}
|
||||
}
|
||||
// if we are not over orginal selection, drop that baby!
|
||||
return htmlEditor->InsertFromDrop(aMouseEvent);
|
||||
return mEditor->InsertFromDrop(aMouseEvent);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -290,7 +290,25 @@ public:
|
|||
* pasteable data in the clipboard.
|
||||
*/
|
||||
NS_IMETHOD CanPaste(PRInt32 aSelectionType, PRBool &aCanPaste)=0;
|
||||
/* ------------ Drag/Drop methods -------------- */
|
||||
|
||||
/**
|
||||
* CanDrag decides if a drag should be started
|
||||
* (for example, based on the current selection and mousepoint).
|
||||
*/
|
||||
NS_IMETHOD CanDrag(nsIDOMEvent *aEvent, PRBool &aCanDrag)=0;
|
||||
|
||||
/**
|
||||
* DoDrag transfers the relevant data (as appropriate)
|
||||
* to a transferable so it can later be dropped.
|
||||
*/
|
||||
NS_IMETHOD DoDrag(nsIDOMEvent *aEvent)=0;
|
||||
|
||||
/**
|
||||
* InsertFromDrop looks for a dragsession and inserts the
|
||||
* relevant data in response to a drop.
|
||||
*/
|
||||
NS_IMETHOD InsertFromDrop(nsIDOMEvent *aEvent)=0;
|
||||
/* ------------ Selection methods -------------- */
|
||||
|
||||
/** sets the document selection to the entire contents of the document */
|
||||
|
|
|
@ -130,26 +130,6 @@ public:
|
|||
*/
|
||||
NS_IMETHOD DecreaseFontSize()=0;
|
||||
|
||||
/* ------------ Drag/Drop methods -------------- */
|
||||
|
||||
/**
|
||||
* CanDrag decides if a drag should be started
|
||||
* (for example, based on the current selection and mousepoint).
|
||||
*/
|
||||
NS_IMETHOD CanDrag(nsIDOMEvent *aEvent, PRBool &aCanDrag)=0;
|
||||
|
||||
/**
|
||||
* DoDrag transfers the relevant data (as appropriate)
|
||||
* to a transferable so it can later be dropped.
|
||||
*/
|
||||
NS_IMETHOD DoDrag(nsIDOMEvent *aEvent)=0;
|
||||
|
||||
/**
|
||||
* InsertFromDrop looks for a dragsession and inserts the
|
||||
* relevant data in response to a drop.
|
||||
*/
|
||||
NS_IMETHOD InsertFromDrop(nsIDOMEvent *aEvent)=0;
|
||||
|
||||
/* ------------ HTML content methods -------------- */
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче