Bug 543864 patch 1: Make RasterImage::GetWidth & GetHeight return 0 in case of errors. r=roc a=roc

This commit is contained in:
Julian Seward 2010-10-06 15:18:52 -07:00
parent a0333b690b
commit 79013f2e5c
2 changed files with 10 additions and 4 deletions

View File

@ -81,12 +81,14 @@ native gfxGraphicsFilter(gfxPattern::GraphicsFilter);
interface imgIContainer : nsISupports
{
/**
* The width of the container rectangle.
* The width of the container rectangle. In the case of any error,
* zero is returned, and an exception will be thrown.
*/
readonly attribute PRInt32 width;
/**
* The height of the container rectangle.
* The height of the container rectangle. In the case of any error,
* zero is returned, and an exception will be thrown.
*/
readonly attribute PRInt32 height;

View File

@ -389,8 +389,10 @@ RasterImage::GetWidth(PRInt32 *aWidth)
{
NS_ENSURE_ARG_POINTER(aWidth);
if (mError)
if (mError) {
*aWidth = 0;
return NS_ERROR_FAILURE;
}
*aWidth = mSize.width;
return NS_OK;
@ -403,8 +405,10 @@ RasterImage::GetHeight(PRInt32 *aHeight)
{
NS_ENSURE_ARG_POINTER(aHeight);
if (mError)
if (mError) {
*aHeight = 0;
return NS_ERROR_FAILURE;
}
*aHeight = mSize.height;
return NS_OK;