From 1f00f858bb3ce55442286f2c7145b3bbd9e5d143 Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Thu, 19 Oct 2000 06:41:24 +0000 Subject: [PATCH] Fix for bug # 55055 r=adamlock sr=rpotts git-svn-id: svn://10.0.0.236/trunk@81440 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/appstrings.properties | 2 +- mozilla/docshell/base/nsDocShell.cpp | 10 +++++++--- mozilla/xpfe/components/shistory/src/nsSHistory.cpp | 9 ++++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mozilla/docshell/base/appstrings.properties b/mozilla/docshell/base/appstrings.properties index b9abe302797..494daa813fc 100644 --- a/mozilla/docshell/base/appstrings.properties +++ b/mozilla/docshell/base/appstrings.properties @@ -21,4 +21,4 @@ dnsNotFound=%s could not be found. Please check the name and try again. protocolNotFound=%s is not a registered protocol. connectionFailure=The connection was refused when attempting to contact %s. netTimeout=The operation timed out when attempting to contact %s. -repost=The page to be loaded has form elements with post data. Do you want to repost the form data? +repost=The page you are trying to view processes data you entered in an online form(such as an order form or a membership application) earlier in this Netscape 6 session. To view the page, re-submitting the data, click Yes. Otherwise, click Cancel. \ No newline at end of file diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 434c338319a..e90b8a72711 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -4054,10 +4054,14 @@ NS_IMETHODIMP nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry) nsresult rv = stringBundle->GetStringFromName(NS_ConvertASCIItoUCS2("repost").GetUnicode(), getter_Copies(messageStr)); - if (NS_SUCCEEDED(rv) && messageStr) { + if (NS_SUCCEEDED(rv) && messageStr) { prompter->Confirm(nsnull, messageStr, &repost); - if (!repost) - postData = nsnull; + /* If the user pressed cancel in the dialog, + * return failure. Don't try to load the page with out + * the post data. + */ + if (!repost) + return NS_ERROR_FAILURE; } } } diff --git a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp index 8ba11e192b7..1343b55233d 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp @@ -507,7 +507,14 @@ nsSHistory::LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType) loadInfo->SetLoadType(aLoadType); loadInfo->SetSHEntry(nextEntry); // Time to initiate a document load - return docShell->LoadURI(nexturi, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE); + nsresult rv = docShell->LoadURI(nexturi, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE); + /* If the loadURI call failed for some reason, + * reset mIndex to what it was. so that back/forward + * won't misbehave + */ + if (!NS_SUCCEEDED(rv)) + mIndex = oldIndex; + return rv; }