Newlines in links should be stripped when selecting "Copy Link Location"

bug 77522 r=harishd sr=jst a=asa patch=tmutreja@netscape.com


git-svn-id: svn://10.0.0.236/trunk@116370 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
badami%netscape.com 2002-03-12 05:29:31 +00:00
parent 74047e4e30
commit 229bfc35d1
2 changed files with 8 additions and 0 deletions

View File

@ -4246,6 +4246,7 @@ NS_IMETHODIMP PresShell::DoCopyLinkLocation(nsIDOMNode* aNode)
NS_ENSURE_ARG_POINTER(aNode);
nsresult rv;
nsAutoString anchorText;
static char strippedChars[] = {'\t','\r','\n'};
// are we an anchor?
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(aNode));
@ -4308,6 +4309,9 @@ NS_IMETHODIMP PresShell::DoCopyLinkLocation(nsIDOMNode* aNode)
nsCOMPtr<nsIClipboardHelper>
clipboard(do_GetService("@mozilla.org/widget/clipboardhelper;1", &rv));
NS_ENSURE_SUCCESS(rv, rv);
//Remove all the '\t', '\r' and '\n' from 'anchorText'
anchorText.StripChars(strippedChars);
// copy the href onto the clipboard
return clipboard->CopyString(anchorText);

View File

@ -4246,6 +4246,7 @@ NS_IMETHODIMP PresShell::DoCopyLinkLocation(nsIDOMNode* aNode)
NS_ENSURE_ARG_POINTER(aNode);
nsresult rv;
nsAutoString anchorText;
static char strippedChars[] = {'\t','\r','\n'};
// are we an anchor?
nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(aNode));
@ -4308,6 +4309,9 @@ NS_IMETHODIMP PresShell::DoCopyLinkLocation(nsIDOMNode* aNode)
nsCOMPtr<nsIClipboardHelper>
clipboard(do_GetService("@mozilla.org/widget/clipboardhelper;1", &rv));
NS_ENSURE_SUCCESS(rv, rv);
//Remove all the '\t', '\r' and '\n' from 'anchorText'
anchorText.StripChars(strippedChars);
// copy the href onto the clipboard
return clipboard->CopyString(anchorText);