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).

This commit is contained in:
tbogard@aol.net
1999-11-29 18:41:59 +00:00
parent 324efbf386
commit 1ab1040470
2 changed files with 14 additions and 15 deletions

View File

@@ -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<nsIPresContext> 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<nsIDocShell> 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<nsIPresContext> 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)