From b85f489d4d1fa0c0d536c2629f3870c47e524ab8 Mon Sep 17 00:00:00 2001 From: "joe.chou%sun.com" Date: Tue, 12 Mar 2002 00:40:03 +0000 Subject: [PATCH] Fix bug 128379, "Reload login page let you into Siebel app", a=jdunn git-svn-id: svn://10.0.0.236/branches/SUN_6_2_1_BRANCH@116356 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/shistory/src/nsSHistory.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp index 9220e166bed..fc681f2a879 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp @@ -405,6 +405,31 @@ nsSHistory::RemoveSHistoryListener(nsISHistoryListener * aListener) return NS_OK; } +/* Replace an entry in the History list at a particular index. + * Do not update index or count. + */ +NS_IMETHODIMP +nsSHistory::ReplaceEntry(PRInt32 aIndex, nsISHEntry * aReplaceEntry) +{ + NS_ENSURE_ARG(aReplaceEntry); + nsresult rv; + nsCOMPtr currentTxn; + + if (!mListRoot) // Session History is not initialised. + return NS_ERROR_FAILURE; + + rv = GetTransactionAtIndex(aIndex, getter_AddRefs(currentTxn)); + + if(currentTxn) + { + // Set the replacement entry in the transaction + rv = currentTxn->SetSHEntry(aReplaceEntry); + rv = currentTxn->SetPersist(PR_TRUE); + } + return rv; +} + + //***************************************************************************** // nsSHistory: nsIWebNavigation //*****************************************************************************