зеркало из https://github.com/mozilla/pjs.git
DD&D now checks for readonly and disabled
b 38773
This commit is contained in:
Родитель
2831215667
Коммит
982188fad6
|
@ -732,6 +732,14 @@ nsTextEditorDragListener::DragEnter(nsIDOMEvent* aDragEvent)
|
||||||
if ( NS_SUCCEEDED(rv) ) {
|
if ( NS_SUCCEEDED(rv) ) {
|
||||||
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
||||||
if ( dragSession ) {
|
if ( dragSession ) {
|
||||||
|
PRUint32 flags;
|
||||||
|
if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) {
|
||||||
|
if ((flags & nsIHTMLEditor::eEditorDisabledMask) ||
|
||||||
|
(flags & nsIHTMLEditor::eEditorReadonlyMask)) {
|
||||||
|
dragSession->SetCanDrop(PR_FALSE);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
PRBool flavorSupported = PR_FALSE;
|
PRBool flavorSupported = PR_FALSE;
|
||||||
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
||||||
if ( !flavorSupported )
|
if ( !flavorSupported )
|
||||||
|
@ -757,6 +765,14 @@ nsTextEditorDragListener::DragOver(nsIDOMEvent* aDragEvent)
|
||||||
if ( NS_SUCCEEDED(rv) ) {
|
if ( NS_SUCCEEDED(rv) ) {
|
||||||
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
||||||
if ( dragSession ) {
|
if ( dragSession ) {
|
||||||
|
PRUint32 flags;
|
||||||
|
if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) {
|
||||||
|
if ((flags & nsIHTMLEditor::eEditorDisabledMask) ||
|
||||||
|
(flags & nsIHTMLEditor::eEditorReadonlyMask)) {
|
||||||
|
dragSession->SetCanDrop(PR_FALSE);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
PRBool flavorSupported = PR_FALSE;
|
PRBool flavorSupported = PR_FALSE;
|
||||||
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
||||||
if ( !flavorSupported )
|
if ( !flavorSupported )
|
||||||
|
|
|
@ -732,6 +732,14 @@ nsTextEditorDragListener::DragEnter(nsIDOMEvent* aDragEvent)
|
||||||
if ( NS_SUCCEEDED(rv) ) {
|
if ( NS_SUCCEEDED(rv) ) {
|
||||||
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
||||||
if ( dragSession ) {
|
if ( dragSession ) {
|
||||||
|
PRUint32 flags;
|
||||||
|
if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) {
|
||||||
|
if ((flags & nsIHTMLEditor::eEditorDisabledMask) ||
|
||||||
|
(flags & nsIHTMLEditor::eEditorReadonlyMask)) {
|
||||||
|
dragSession->SetCanDrop(PR_FALSE);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
PRBool flavorSupported = PR_FALSE;
|
PRBool flavorSupported = PR_FALSE;
|
||||||
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
||||||
if ( !flavorSupported )
|
if ( !flavorSupported )
|
||||||
|
@ -757,6 +765,14 @@ nsTextEditorDragListener::DragOver(nsIDOMEvent* aDragEvent)
|
||||||
if ( NS_SUCCEEDED(rv) ) {
|
if ( NS_SUCCEEDED(rv) ) {
|
||||||
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
|
||||||
if ( dragSession ) {
|
if ( dragSession ) {
|
||||||
|
PRUint32 flags;
|
||||||
|
if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) {
|
||||||
|
if ((flags & nsIHTMLEditor::eEditorDisabledMask) ||
|
||||||
|
(flags & nsIHTMLEditor::eEditorReadonlyMask)) {
|
||||||
|
dragSession->SetCanDrop(PR_FALSE);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
PRBool flavorSupported = PR_FALSE;
|
PRBool flavorSupported = PR_FALSE;
|
||||||
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
|
||||||
if ( !flavorSupported )
|
if ( !flavorSupported )
|
||||||
|
|
Загрузка…
Ссылка в новой задаче