From e9fc3b80391f804184947852ae1ee31734a143a2 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Tue, 31 Aug 1999 00:20:11 +0000 Subject: [PATCH] SizeContentTo sizes content webshell (was sizing chrome webshell) --- xpfe/appshell/src/nsWebShellWindow.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index c5f28948ef96..a8171dc8783f 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -2638,16 +2638,21 @@ NS_IMETHODIMP nsWebShellWindow::SizeWindowTo(PRInt32 aWidth, PRInt32 aHeight) NS_IMETHODIMP nsWebShellWindow::SizeContentTo(PRInt32 aWidth, PRInt32 aHeight) { - PRInt32 x,y,width,height; - mWebShell->GetBounds(x,y,width,height); - PRInt32 aWidthDelta = aWidth - width; - PRInt32 aHeightDelta = aHeight - height; + nsCOMPtr content; + GetContentWebShell(getter_AddRefs(content)); + if (content) { + PRInt32 x, y, width, height, + widthDelta, heightDelta; + content->GetBounds(x,y,width,height); + widthDelta = aWidth - width; + heightDelta = aHeight - height; - nsRect windowBounds; - mWindow->GetBounds(windowBounds); - mWindow->Resize(windowBounds.width + aWidthDelta, - windowBounds.height + aHeightDelta, - PR_TRUE); + nsRect windowBounds; + mWindow->GetBounds(windowBounds); + mWindow->Resize(windowBounds.width + widthDelta, + windowBounds.height + heightDelta, + PR_TRUE); + } return NS_OK; }