Bug 315370: text Copy/Paste from Firefox to Outlook will be created as attachment, patch by David Gardiner <David.R.Gardiner@gmail.com>, r+sr=roc

This commit is contained in:
gavin%gavinsharp.com 2006-04-21 15:16:22 +00:00
parent d3b36dd023
commit 17ca1575dc
2 changed files with 16 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -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<nsISupportsString> urlObject ( do_QueryInterface(genericURL) );
if ( urlObject ) {
nsAutoString url;
urlObject->GetData ( url );
outURL = url;
rv = NS_OK;
}
} // if found flavor
return rv;