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

This commit is contained in:
Daniel Holbert 2010-10-06 15:18:52 -07:00
Родитель 7ff86033dd
Коммит 22914ca238
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -310,11 +310,13 @@ NS_IMETHODIMP
VectorImage::GetWidth(PRInt32* aWidth)
{
if (mError || !mIsFullyLoaded) {
*aWidth = 0;
return NS_ERROR_FAILURE;
}
if (!mSVGDocumentWrapper->GetWidthOrHeight(SVGDocumentWrapper::eWidth,
*aWidth)) {
*aWidth = 0;
return NS_ERROR_FAILURE;
}
@ -327,11 +329,13 @@ NS_IMETHODIMP
VectorImage::GetHeight(PRInt32* aHeight)
{
if (mError || !mIsFullyLoaded) {
*aHeight = 0;
return NS_ERROR_FAILURE;
}
if (!mSVGDocumentWrapper->GetWidthOrHeight(SVGDocumentWrapper::eHeight,
*aHeight)) {
*aHeight = 0;
return NS_ERROR_FAILURE;
}