From 3412db77ba943d37bc1a9e441ec38ddcdcf269a5 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Mon, 14 Feb 2000 06:19:18 +0000 Subject: [PATCH] Removed unused GetPresShell(). Rely on nsXULWindow for the implmentation of SetIntrinsicSizing. SetStatus now flows through the nsXULWindow content tree owner. r=hyatt git-svn-id: svn://10.0.0.236/trunk@60701 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpfe/appshell/src/nsWebShellWindow.cpp | 78 +++---------------- mozilla/xpfe/appshell/src/nsWebShellWindow.h | 4 - 2 files changed, 9 insertions(+), 73 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 7923845e2db..1c31c61b1f4 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -1101,40 +1101,6 @@ nsWebShellWindow::ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindow** return NS_OK; } -NS_IMETHODIMP -nsWebShellWindow::GetPresShell(nsIPresShell** aPresShell) -{ - nsresult rv = NS_OK; - - nsCOMPtr contentViewer; - NS_ENSURE_SUCCESS(mWebShell->GetContentViewer(getter_AddRefs(contentViewer)), - NS_ERROR_FAILURE); - - nsCOMPtr docViewer; - docViewer = do_QueryInterface(contentViewer); - if (!docViewer) { - NS_ERROR("Document viewer interface not supported by the content viewer."); - return NS_ERROR_FAILURE; - } - - nsCOMPtr presContext; - if (NS_FAILED(rv = docViewer->GetPresContext(*getter_AddRefs(presContext)))) { - NS_ERROR("Unable to retrieve the doc viewer's presentation context."); - return NS_ERROR_FAILURE; - } - - nsCOMPtr presShell; - if (NS_FAILED(rv = presContext->GetShell(getter_AddRefs(presShell)))) { - NS_ERROR("Unable to retrieve the pres shell."); - return NS_ERROR_FAILURE; - } - - *aPresShell = presShell.get(); - NS_IF_ADDREF(*aPresShell); - - return NS_OK; -} - //---------------------------------------- // nsIWebShellWindow methods... //---------------------------------------- @@ -1981,51 +1947,26 @@ nsWebShellWindow::NotifyObservers( const nsString &aTopic, const nsString &someD NS_IMETHODIMP nsWebShellWindow::SetStatus(const PRUnichar* aStatus) { - nsresult rv = NS_OK; - // Store status text unless empty string was set, then use defaultStatus - mStatus = aStatus; - if (mStatus.Length() == 0) { - mStatus = mDefaultStatus; - } - // Broadcast status text change to interested parties. - nsAutoString statusName("status"); - nsAutoString statusValue(aStatus); - rv = NotifyObservers( statusName, statusValue ); - return rv; + NS_ENSURE_SUCCESS(EnsureContentTreeOwner(), NS_ERROR_FAILURE); + return mContentTreeOwner->SetJSStatus(aStatus); } NS_IMETHODIMP nsWebShellWindow::GetStatus(const PRUnichar** aResult) { - nsresult rv = NS_OK; - if ( aResult ) { - // Semantics are ill-defined: How to allocate? Who frees it? - *aResult = mStatus.ToNewUnicode(); - } else { - rv = NS_ERROR_NULL_POINTER; - } - return rv; + NS_ERROR("Can't use this anymore"); + return NS_ERROR_FAILURE; } NS_IMETHODIMP nsWebShellWindow::SetDefaultStatus(const PRUnichar* aStatus) { - nsresult rv = NS_OK; - // Store status text. - mDefaultStatus = aStatus; - // Broadcast status text change to interested parties. - rv = NotifyObservers( "defaultStatus", aStatus ); - return rv; + NS_ENSURE_SUCCESS(EnsureContentTreeOwner(), NS_ERROR_FAILURE); + return mContentTreeOwner->SetJSDefaultStatus(aStatus); } NS_IMETHODIMP nsWebShellWindow::GetDefaultStatus(const PRUnichar** aResult) { - nsresult rv = NS_OK; - if ( aResult ) { - // Semantics are ill-defined: How to allocate? Who frees it? - *aResult = mDefaultStatus.ToNewUnicode(); - } else { - rv = NS_ERROR_NULL_POINTER; - } - return rv; + NS_ERROR("Can't use this anymore"); + return NS_ERROR_FAILURE; } NS_IMETHODIMP nsWebShellWindow::SetProgress(PRInt32 aProgress, PRInt32 aProgressMax) @@ -2050,8 +1991,7 @@ NS_IMETHODIMP nsWebShellWindow::SetProgress(PRInt32 aProgress, PRInt32 aProgress NS_IMETHODIMP nsWebShellWindow::IsIntrinsicallySized(PRBool& aResult) { - aResult = mIntrinsicallySized; - return NS_OK; + return GetIntrinsicallySized(&aResult); } diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.h b/mozilla/xpfe/appshell/src/nsWebShellWindow.h index 4c51a9fbf1a..2c7e644797a 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.h +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.h @@ -120,8 +120,6 @@ public: nsWidgetInitData& widgetInitData); nsIWidget* GetWidget(void) { return mWindow; } - void SetIntrinsicallySized(PRBool isIntrinsicallySized) { mIntrinsicallySized = isIntrinsicallySized; }; - void DoContextMenu( nsMenuEvent * aMenuEvent, nsIDOMNode * aMenuNode, @@ -231,8 +229,6 @@ protected: PRInt32 GetDocHeight(nsIDocument * aDoc); - NS_IMETHOD GetPresShell(nsIPresShell** aResult); - void LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWindow); void DynamicLoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWindow); nsCOMPtr FindNamedDOMNode(const nsString &aName, nsIDOMNode * aParent, PRInt32 & aCount, PRInt32 aEndCount);