зеркало из https://github.com/mozilla/gecko-dev.git
Fix derefing null pointer during print preview of java.sun.com bug 125396 r=av sr=attinasi
This commit is contained in:
Родитель
103fe052db
Коммит
2895dcd901
|
@ -1674,7 +1674,12 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
// get a few things
|
// get a few things
|
||||||
nsCOMPtr<nsIPrintSettings> printSettings;
|
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);
|
printSettings->GetMarginInTwips(margin);
|
||||||
|
|
||||||
aPresContext->GetTwipsToPixels(&t2p);
|
aPresContext->GetTwipsToPixels(&t2p);
|
||||||
|
|
|
@ -1674,7 +1674,12 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
// get a few things
|
// get a few things
|
||||||
nsCOMPtr<nsIPrintSettings> printSettings;
|
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);
|
printSettings->GetMarginInTwips(margin);
|
||||||
|
|
||||||
aPresContext->GetTwipsToPixels(&t2p);
|
aPresContext->GetTwipsToPixels(&t2p);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче