From 0a2fa6b2a6fa23af33084ccc68fccfd56fc02ee4 Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Fri, 21 Apr 2006 15:16:22 +0000 Subject: [PATCH] Bug 315370: text Copy/Paste from Firefox to Outlook will be created as attachment, patch by David Gardiner , r+sr=roc git-svn-id: svn://10.0.0.236/trunk@195059 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsCopySupport.cpp | 8 ++++---- mozilla/widget/src/windows/nsDataObj.cpp | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mozilla/content/base/src/nsCopySupport.cpp b/mozilla/content/base/src/nsCopySupport.cpp index 941efd55e4c..67739f0a258 100644 --- a/mozilla/content/base/src/nsCopySupport.cpp +++ b/mozilla/content/base/src/nsCopySupport.cpp @@ -209,11 +209,11 @@ nsresult nsCopySupport::HTMLCopy(nsISelection *aSel, nsIDocument *aDoc, PRInt16 if (!spec.IsEmpty()) { nsAutoString shortcut; AppendUTF8toUTF16(spec, shortcut); - shortcut.Append(PRUnichar('\n')); - shortcut.Append(aDoc->GetDocumentTitle()); - // Add the URL DataFlavor to the transferable - rv = AppendString(trans, shortcut, kURLMime); + // Add the URL DataFlavor to the transferable. Don't use kURLMime, as it will + // cause an unnecessary UniformResourceLocator to be added which confuses + // some apps eg. Outlook 2000 - (See Bug 315370) + rv = AppendString(trans, shortcut, kURLDataMime ); NS_ENSURE_SUCCESS(rv, rv); } } diff --git a/mozilla/widget/src/windows/nsDataObj.cpp b/mozilla/widget/src/windows/nsDataObj.cpp index 8d8d010029f..e8ab03ed477 100644 --- a/mozilla/widget/src/windows/nsDataObj.cpp +++ b/mozilla/widget/src/windows/nsDataObj.cpp @@ -1136,7 +1136,7 @@ void nsDataObj::SetTransferable(nsITransferable * aTransferable) nsresult nsDataObj :: ExtractShortcutURL ( nsString & outURL ) { - NS_ASSERTION ( mTransferable, "We'd don't have a good transferable" ); + NS_ASSERTION ( mTransferable, "We don't have a good transferable" ); nsresult rv = NS_ERROR_FAILURE; PRUint32 len = 0; @@ -1157,7 +1157,17 @@ nsDataObj :: ExtractShortcutURL ( nsString & outURL ) rv = NS_OK; } } - } // if found flavor + } else if ( NS_SUCCEEDED(mTransferable->GetTransferData(kURLDataMime, getter_AddRefs(genericURL), &len)) ) { + nsCOMPtr urlObject ( do_QueryInterface(genericURL) ); + if ( urlObject ) { + nsAutoString url; + urlObject->GetData ( url ); + outURL = url; + + rv = NS_OK; + } + + } // if found flavor return rv;