From 9afdb2b0d4e1c73288ec072f4783b63835a9b646 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Thu, 26 Apr 2001 19:05:08 +0000 Subject: [PATCH] use GetCurrentSession() instead of QI to get drag session from service. r=pchen/sr=sfraser. bug# 77380 git-svn-id: svn://10.0.0.236/trunk@93168 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsEditorEventListeners.cpp | 6 ++++-- mozilla/editor/base/nsHTMLDataTransfer.cpp | 4 ++-- mozilla/editor/base/nsPlaintextDataTransfer.cpp | 4 ++-- mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp | 4 ++-- mozilla/editor/libeditor/text/nsEditorEventListeners.cpp | 6 ++++-- mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp | 4 ++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mozilla/editor/base/nsEditorEventListeners.cpp b/mozilla/editor/base/nsEditorEventListeners.cpp index 3a041e8b4fd..14782746ce1 100644 --- a/mozilla/editor/base/nsEditorEventListeners.cpp +++ b/mozilla/editor/base/nsEditorEventListeners.cpp @@ -636,7 +636,8 @@ nsTextEditorDragListener::DragOver(nsIDOMEvent* aDragEvent) nsresult rv; NS_WITH_SERVICE ( nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv ); if ( NS_SUCCEEDED(rv) ) { - nsCOMPtr dragSession(do_QueryInterface(dragService)); + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if ( dragSession ) { PRUint32 flags; if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) { @@ -694,7 +695,8 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent) // editfields if that is what is desired. } - nsCOMPtr dragSession(do_QueryInterface(dragService)); + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if (dragSession) { PRBool flavorSupported = PR_FALSE; diff --git a/mozilla/editor/base/nsHTMLDataTransfer.cpp b/mozilla/editor/base/nsHTMLDataTransfer.cpp index 5cfcb6a55f1..40c0ca8e87a 100644 --- a/mozilla/editor/base/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/base/nsHTMLDataTransfer.cpp @@ -741,8 +741,8 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromDrop(nsIDOMEvent* aDropEvent) NS_WITH_SERVICE(nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv); if (NS_FAILED(rv)) return rv; - nsCOMPtr dragSession(do_QueryInterface(dragService)); - + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if (!dragSession) return NS_OK; // Get the nsITransferable interface for getting the data from the drop diff --git a/mozilla/editor/base/nsPlaintextDataTransfer.cpp b/mozilla/editor/base/nsPlaintextDataTransfer.cpp index 39fa66f4104..f600e63a95c 100644 --- a/mozilla/editor/base/nsPlaintextDataTransfer.cpp +++ b/mozilla/editor/base/nsPlaintextDataTransfer.cpp @@ -187,8 +187,8 @@ NS_IMETHODIMP nsPlaintextEditor::InsertFromDrop(nsIDOMEvent* aDropEvent) NS_WITH_SERVICE(nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv); if (NS_FAILED(rv)) return rv; - nsCOMPtr dragSession(do_QueryInterface(dragService)); - + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if (!dragSession) return NS_OK; // Get the nsITransferable interface for getting the data from the drop diff --git a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp index 5cfcb6a55f1..40c0ca8e87a 100644 --- a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -741,8 +741,8 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromDrop(nsIDOMEvent* aDropEvent) NS_WITH_SERVICE(nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv); if (NS_FAILED(rv)) return rv; - nsCOMPtr dragSession(do_QueryInterface(dragService)); - + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if (!dragSession) return NS_OK; // Get the nsITransferable interface for getting the data from the drop diff --git a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp index 3a041e8b4fd..14782746ce1 100644 --- a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp @@ -636,7 +636,8 @@ nsTextEditorDragListener::DragOver(nsIDOMEvent* aDragEvent) nsresult rv; NS_WITH_SERVICE ( nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv ); if ( NS_SUCCEEDED(rv) ) { - nsCOMPtr dragSession(do_QueryInterface(dragService)); + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if ( dragSession ) { PRUint32 flags; if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) { @@ -694,7 +695,8 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent) // editfields if that is what is desired. } - nsCOMPtr dragSession(do_QueryInterface(dragService)); + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if (dragSession) { PRBool flavorSupported = PR_FALSE; diff --git a/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp b/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp index 39fa66f4104..f600e63a95c 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextDataTransfer.cpp @@ -187,8 +187,8 @@ NS_IMETHODIMP nsPlaintextEditor::InsertFromDrop(nsIDOMEvent* aDropEvent) NS_WITH_SERVICE(nsIDragService, dragService, "@mozilla.org/widget/dragservice;1", &rv); if (NS_FAILED(rv)) return rv; - nsCOMPtr dragSession(do_QueryInterface(dragService)); - + nsCOMPtr dragSession; + dragService->GetCurrentSession(getter_AddRefs(dragService))); if (!dragSession) return NS_OK; // Get the nsITransferable interface for getting the data from the drop