mHistoryCurrentIndex = aGotoIndex; if (hCurrentEntry != nsnull)
int indix = 0; GetCurrentIndex(&indix); PRBool isInHist=PR_FALSE; if (indix >= 0) { nsCOMPtr<nsISupports>  historyState; nsresult rv = prev->GetHistoryState(getter_AddRefs(historyState)); if (NS_SUCCEEDED(rv) && historyState) SetHistoryObjectForIndex(indix, historyState); }   mHistoryCurrentIndex = aGotoIndex; if (hCurrentEntry != nsnull) {
nsSessionHistory::Goto(PRInt32 aGotoIndex, nsIWebShell * prev, PRBool aIsReload){   PRBool result = PR_FALSE;   if ((aGotoIndex < 0) ||  (aGotoIndex >= mHistoryLength))      return NS_ERROR_FAILURE;   if (!prev)	   return NS_ERROR_NULL_POINTER;   nsHistoryEntry * hCurrentEntry = nsnull;   //get a handle to the current page to be passed to nsHistoryEntry   // as the previous page.   hCurrentEntry = (nsHistoryEntry *) mHistoryEntries.ElementAt(aGotoIndex);   // Set the flag that indicates that we are currently   // traversing with it the history   mIsLoadingDoc = PR_TRUE;   mHistoryEntryInLoad = hCurrentEntry;  //Load the page   char * url;   hCurrentEntry->GetURL(&url);   if (APP_DEBUG && url) printf("nsSessionHistory::Goto, Trying to load URL %s\n", url);   Recycle (url);      mHistoryCurrentIndex = aGotoIndex;    if (hCurrentEntry != nsnull)       result = hCurrentEntry->Load(prev, aIsReload);    if (!result) {       mIsLoadingDoc = PR_FALSE;       mHistoryEntryInLoad = (nsHistoryEntry *) nsnull;    }   return NS_OK;}