From 9eb6fb68faeb513e81612da6f8f708331dd35427 Mon Sep 17 00:00:00 2001 From: "jst%netscape.com" Date: Sun, 2 Apr 2000 22:05:10 +0000 Subject: [PATCH] Minor cleanup and fixing a compier warning. git-svn-id: svn://10.0.0.236/trunk@64960 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocument.cpp | 14 ++++++++------ mozilla/layout/base/src/nsDocument.cpp | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index 0088cdbcc4d..7b01b89581f 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -2152,10 +2152,8 @@ nsDocument::GetWidth(PRInt32* aWidth) { NS_ENSURE_ARG_POINTER(aWidth); - *aWidth = 0; - - nsresult result = NS_OK; nsCOMPtr shell; + nsresult result = NS_OK; // We make the assumption that the first presentation shell // is the one for which we need information. @@ -2165,7 +2163,8 @@ nsDocument::GetWidth(PRInt32* aWidth) result = GetPixelDimensions(shell, &width, &height); *aWidth = width; - } + } else + *aWidth = 0; return result; } @@ -2173,8 +2172,10 @@ nsDocument::GetWidth(PRInt32* aWidth) NS_IMETHODIMP nsDocument::GetHeight(PRInt32* aHeight) { - nsresult result; + NS_ENSURE_ARG_POINTER(aHeight); + nsCOMPtr shell; + nsresult result = NS_OK; // We make the assumption that the first presentation shell // is the one for which we need information. @@ -2184,7 +2185,8 @@ nsDocument::GetHeight(PRInt32* aHeight) result = GetPixelDimensions(shell, &width, &height); *aHeight = height; - } + } else + *aHeight = 0; return result; } diff --git a/mozilla/layout/base/src/nsDocument.cpp b/mozilla/layout/base/src/nsDocument.cpp index 0088cdbcc4d..7b01b89581f 100644 --- a/mozilla/layout/base/src/nsDocument.cpp +++ b/mozilla/layout/base/src/nsDocument.cpp @@ -2152,10 +2152,8 @@ nsDocument::GetWidth(PRInt32* aWidth) { NS_ENSURE_ARG_POINTER(aWidth); - *aWidth = 0; - - nsresult result = NS_OK; nsCOMPtr shell; + nsresult result = NS_OK; // We make the assumption that the first presentation shell // is the one for which we need information. @@ -2165,7 +2163,8 @@ nsDocument::GetWidth(PRInt32* aWidth) result = GetPixelDimensions(shell, &width, &height); *aWidth = width; - } + } else + *aWidth = 0; return result; } @@ -2173,8 +2172,10 @@ nsDocument::GetWidth(PRInt32* aWidth) NS_IMETHODIMP nsDocument::GetHeight(PRInt32* aHeight) { - nsresult result; + NS_ENSURE_ARG_POINTER(aHeight); + nsCOMPtr shell; + nsresult result = NS_OK; // We make the assumption that the first presentation shell // is the one for which we need information. @@ -2184,7 +2185,8 @@ nsDocument::GetHeight(PRInt32* aHeight) result = GetPixelDimensions(shell, &width, &height); *aHeight = height; - } + } else + *aHeight = 0; return result; }