DD&D now checks for readonly and disabled

b 38773
This commit is contained in:
rods%netscape.com 2000-05-16 21:57:06 +00:00
parent d38082b473
commit 0516e9165c
2 changed files with 32 additions and 0 deletions

View File

@ -732,6 +732,14 @@ nsTextEditorDragListener::DragEnter(nsIDOMEvent* aDragEvent)
if ( NS_SUCCEEDED(rv) ) {
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
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;
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
if ( !flavorSupported )
@ -757,6 +765,14 @@ nsTextEditorDragListener::DragOver(nsIDOMEvent* aDragEvent)
if ( NS_SUCCEEDED(rv) ) {
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
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;
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
if ( !flavorSupported )

View File

@ -732,6 +732,14 @@ nsTextEditorDragListener::DragEnter(nsIDOMEvent* aDragEvent)
if ( NS_SUCCEEDED(rv) ) {
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
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;
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
if ( !flavorSupported )
@ -757,6 +765,14 @@ nsTextEditorDragListener::DragOver(nsIDOMEvent* aDragEvent)
if ( NS_SUCCEEDED(rv) ) {
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
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;
dragSession->IsDataFlavorSupported(kUnicodeMime, &flavorSupported);
if ( !flavorSupported )