Fix derefing null pointer during print preview of java.sun.com bug 125396 r=av sr=attinasi

This commit is contained in:
peterlubczynski%netscape.com 2002-02-16 05:12:45 +00:00
Родитель 103fe052db
Коммит 2895dcd901
2 изменённых файлов: 12 добавлений и 2 удалений

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

@ -1674,7 +1674,12 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
// get a few things
nsCOMPtr<nsIPrintSettings> printSettings;
thePrinterContext->GetPrintSettings(getter_AddRefs(printSettings));
if (thePrinterContext)
thePrinterContext->GetPrintSettings(getter_AddRefs(printSettings));
else if (thePrintPreviewContext)
thePrintPreviewContext->GetPrintSettings(getter_AddRefs(printSettings));
NS_ENSURE_TRUE(printSettings, NS_ERROR_FAILURE);
printSettings->GetMarginInTwips(margin);
aPresContext->GetTwipsToPixels(&t2p);

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

@ -1674,7 +1674,12 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
// get a few things
nsCOMPtr<nsIPrintSettings> printSettings;
thePrinterContext->GetPrintSettings(getter_AddRefs(printSettings));
if (thePrinterContext)
thePrinterContext->GetPrintSettings(getter_AddRefs(printSettings));
else if (thePrintPreviewContext)
thePrintPreviewContext->GetPrintSettings(getter_AddRefs(printSettings));
NS_ENSURE_TRUE(printSettings, NS_ERROR_FAILURE);
printSettings->GetMarginInTwips(margin);
aPresContext->GetTwipsToPixels(&t2p);