From 1f92049a424e9e257809d429a2331a6d36926026 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Mon, 29 Nov 1999 18:41:59 +0000 Subject: [PATCH] Changes to reflect the fact that the nsIDocShell API now has a GetPresShell. Used NS_STATIC_CAST on a comparison to 'this'. (Not Part of build). git-svn-id: svn://10.0.0.236/trunk@54568 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 28 ++++++++++++++-------------- mozilla/docshell/base/nsDocShell.h | 1 - 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index b93b17b374f..29a46db979a 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -320,6 +320,19 @@ NS_IMETHODIMP nsDocShell::GetPresContext(nsIPresContext** aPresContext) return NS_OK; } +NS_IMETHODIMP nsDocShell::GetPresShell(nsIPresShell** aPresShell) +{ + NS_ENSURE_ARG_POINTER(aPresShell); + + nsCOMPtr presContext; + NS_ENSURE_SUCCESS(GetPresContext(getter_AddRefs(presContext)), + NS_ERROR_FAILURE); + + NS_ENSURE_SUCCESS(presContext->GetShell(aPresShell), NS_ERROR_FAILURE); + + return NS_OK; +} + NS_IMETHODIMP nsDocShell::GetContentViewer(nsIContentViewer** aContentViewer) { NS_ENSURE_ARG_POINTER(aContentViewer); @@ -390,7 +403,7 @@ NS_IMETHODIMP nsDocShell::SetPrefs(nsIPref* aPrefs) NS_IMETHODIMP nsDocShell::GetRootDocShell(nsIDocShell** aRootDocShell) { NS_ENSURE_ARG_POINTER(aRootDocShell); - *aRootDocShell = this; + *aRootDocShell = NS_STATIC_CAST(nsIDocShell*, this); nsCOMPtr parent; NS_ENSURE_TRUE(GetParent(getter_AddRefs(parent)), NS_ERROR_FAILURE); @@ -1537,19 +1550,6 @@ nsresult nsDocShell::GetRootScrollableView(nsIScrollableView** aOutScrollView) return NS_OK; } -nsresult nsDocShell::GetPresShell(nsIPresShell** aPresShell) -{ - NS_ENSURE_ARG_POINTER(aPresShell); - - nsCOMPtr presContext; - NS_ENSURE_SUCCESS(GetPresContext(getter_AddRefs(presContext)), - NS_ERROR_FAILURE); - - NS_ENSURE_SUCCESS(presContext->GetShell(aPresShell), NS_ERROR_FAILURE); - - return NS_OK; -} - nsresult nsDocShell::EnsureContentListener() { if(mContentListener) diff --git a/mozilla/docshell/base/nsDocShell.h b/mozilla/docshell/base/nsDocShell.h index 286e97131b5..1dddb02f243 100644 --- a/mozilla/docshell/base/nsDocShell.h +++ b/mozilla/docshell/base/nsDocShell.h @@ -103,7 +103,6 @@ protected: nsresult GetChildOffset(nsIDOMNode* aChild, nsIDOMNode* aParent, PRInt32* aOffset); nsresult GetRootScrollableView(nsIScrollableView** aOutScrollView); - nsresult GetPresShell(nsIPresShell** aPresShell); nsresult EnsureContentListener(); void SetCurrentURI(nsIURI* aUri);