adding null check to fix orangeness.

This commit is contained in:
pavlov%netscape.com 2001-10-06 08:19:44 +00:00
Родитель 3aa1438307
Коммит 781fe5aa1e
2 изменённых файлов: 14 добавлений и 10 удалений

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

@ -696,11 +696,13 @@ nsImageFrame::GetDesiredSize(nsIPresContext* aPresContext,
// if mLoads[0].mIntrinsicSize.width and height are 0, then we should check to see
// if the size is already known by the image container.
if (mLoads[0].mIntrinsicSize.width == 0 && mLoads[0].mIntrinsicSize.height == 0) {
nsCOMPtr<imgIContainer> con;
mLoads[0].mRequest->GetImage(getter_AddRefs(con));
if (con) {
con->GetWidth(&mLoads[0].mIntrinsicSize.width);
con->GetHeight(&mLoads[0].mIntrinsicSize.height);
if (mLoads[0].mRequest) {
nsCOMPtr<imgIContainer> con;
mLoads[0].mRequest->GetImage(getter_AddRefs(con));
if (con) {
con->GetWidth(&mLoads[0].mIntrinsicSize.width);
con->GetHeight(&mLoads[0].mIntrinsicSize.height);
}
}
}
mIntrinsicSize = mLoads[0].mIntrinsicSize;

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

@ -696,11 +696,13 @@ nsImageFrame::GetDesiredSize(nsIPresContext* aPresContext,
// if mLoads[0].mIntrinsicSize.width and height are 0, then we should check to see
// if the size is already known by the image container.
if (mLoads[0].mIntrinsicSize.width == 0 && mLoads[0].mIntrinsicSize.height == 0) {
nsCOMPtr<imgIContainer> con;
mLoads[0].mRequest->GetImage(getter_AddRefs(con));
if (con) {
con->GetWidth(&mLoads[0].mIntrinsicSize.width);
con->GetHeight(&mLoads[0].mIntrinsicSize.height);
if (mLoads[0].mRequest) {
nsCOMPtr<imgIContainer> con;
mLoads[0].mRequest->GetImage(getter_AddRefs(con));
if (con) {
con->GetWidth(&mLoads[0].mIntrinsicSize.width);
con->GetHeight(&mLoads[0].mIntrinsicSize.height);
}
}
}
mIntrinsicSize = mLoads[0].mIntrinsicSize;