From 6f99d05f740648fb24f358ce91961f8c86e031d6 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Sat, 11 Mar 2000 11:58:13 +0000 Subject: [PATCH] Fixed ordering of member variable initialization to fix compiler warnings. Back() and Forward() now use the nsIWebNavigation interface instead of the old nsIWebShell one. --- dom/src/base/nsHistory.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dom/src/base/nsHistory.cpp b/dom/src/base/nsHistory.cpp index 660b7fb74d36..5785bfd4e6c1 100644 --- a/dom/src/base/nsHistory.cpp +++ b/dom/src/base/nsHistory.cpp @@ -28,12 +28,13 @@ #include "nsIScriptGlobalObject.h" #include "nsIWebShell.h" #include "nsIDocShell.h" +#include "nsIWebNavigation.h" // // History class implementation // -HistoryImpl::HistoryImpl(nsIDocShell* aDocShell) : mScriptObject(nsnull), - mDocShell(aDocShell) +HistoryImpl::HistoryImpl(nsIDocShell* aDocShell) : mDocShell(aDocShell), + mScriptObject(nsnull) { NS_INIT_REFCNT(); } @@ -138,23 +139,23 @@ HistoryImpl::GetNext(nsString& aNext) NS_IMETHODIMP HistoryImpl::Back() { - nsCOMPtr webShell(do_QueryInterface(mDocShell)); - if (webShell && NS_OK == webShell->CanBack()) { - webShell->Back(); - } - - return NS_OK; + nsCOMPtr webNav(do_QueryInterface(mDocShell)); + if(!webNav) + return NS_OK; + + webNav->GoBack(); + return NS_OK; } NS_IMETHODIMP HistoryImpl::Forward() { - nsCOMPtr webShell(do_QueryInterface(mDocShell)); - if (webShell && NS_OK == webShell->CanForward()) { - webShell->Forward(); - } + nsCOMPtr webNav(do_QueryInterface(mDocShell)); + if(!webNav) + return NS_OK; - return NS_OK; + webNav->GoForward(); + return NS_OK; } NS_IMETHODIMP