From 3068fe3dd975f00cc4641ff00abc95c5aae94c0a Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Tue, 11 Jan 2000 01:11:31 +0000 Subject: [PATCH] Bug 22294. Use aURI's spec (rather than mURL) to cough up a URL for global history. r=mscott git-svn-id: svn://10.0.0.236/trunk@57315 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 9 ++++++++- mozilla/webshell/src/nsWebShell.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 55d55851d68..665dedc59e5 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1517,7 +1517,14 @@ nsWebShell::DoLoadURL(nsIURI * aUri, NS_WITH_SERVICE(nsIGlobalHistory, history, "component://netscape/browser/global-history", &rv); if (NS_FAILED(rv)) break; - rv = history->AddPage(nsCAutoString(mURL), nsnull /* referrer */, PR_Now()); + nsXPIDLCString spec; + rv = aUri->GetSpec(getter_Copies(spec)); + if (NS_FAILED(rv)) break; + + if (! spec) + break; + + rv = history->AddPage(spec, nsnull /* referrer */, PR_Now()); if (NS_FAILED(rv)) break; } while (0); diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 55d55851d68..665dedc59e5 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -1517,7 +1517,14 @@ nsWebShell::DoLoadURL(nsIURI * aUri, NS_WITH_SERVICE(nsIGlobalHistory, history, "component://netscape/browser/global-history", &rv); if (NS_FAILED(rv)) break; - rv = history->AddPage(nsCAutoString(mURL), nsnull /* referrer */, PR_Now()); + nsXPIDLCString spec; + rv = aUri->GetSpec(getter_Copies(spec)); + if (NS_FAILED(rv)) break; + + if (! spec) + break; + + rv = history->AddPage(spec, nsnull /* referrer */, PR_Now()); if (NS_FAILED(rv)) break; } while (0);