Guarantee that the pres context's device context will be non-null by returning failure from Init() if it's null. Rename inline getter GetDeviceContext() to DeviceContext(), convert all callers to use the inline getter, and remove the virtual/refcounting getter. Bug 229371, r+sr=dbaron.
git-svn-id: svn://10.0.0.236/trunk@152182 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1184,11 +1184,9 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
|
||||
nsStyleContext* optStyle = optFrame->GetStyleContext();
|
||||
if (optStyle) {
|
||||
const nsStyleFont* styleFont = optStyle->GetStyleFont();
|
||||
nsCOMPtr<nsIDeviceContext> deviceContext;
|
||||
aPresContext->GetDeviceContext(getter_AddRefs(deviceContext));
|
||||
NS_ASSERTION(deviceContext, "Couldn't get the device context");
|
||||
nsIFontMetrics * fontMet;
|
||||
result = deviceContext->GetMetricsFor(styleFont->mFont, fontMet);
|
||||
result = aPresContext->DeviceContext()->
|
||||
GetMetricsFor(styleFont->mFont, fontMet);
|
||||
if (NS_SUCCEEDED(result) && fontMet != nsnull) {
|
||||
if (fontMet) {
|
||||
fontMet->GetHeight(heightOfARow);
|
||||
|
||||
Reference in New Issue
Block a user