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:
@@ -1560,18 +1560,16 @@ nsRuleNode::SetFont(nsIPresContext* aPresContext, nsStyleContext* aContext,
|
||||
case NS_STYLE_FONT_FIELD: sysID = eSystemFont_Field; break;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDeviceContext> dc;
|
||||
aPresContext->GetDeviceContext(getter_AddRefs(dc));
|
||||
if (dc) {
|
||||
// GetSystemFont sets the font face but not necessarily the size
|
||||
aFont->mFont.size = defaultVariableFont->size;
|
||||
if (NS_FAILED(dc->GetSystemFont(sysID, &aFont->mFont))) {
|
||||
// GetSystemFont sets the font face but not necessarily the size
|
||||
aFont->mFont.size = defaultVariableFont->size;
|
||||
|
||||
if (NS_FAILED(aPresContext->DeviceContext()->GetSystemFont(sysID,
|
||||
&aFont->mFont))) {
|
||||
aFont->mFont.name = defaultVariableFont->name;
|
||||
}
|
||||
// this becomes our cascading size
|
||||
aFont->mSize = aFont->mFont.size
|
||||
= nsStyleFont::ZoomText(aPresContext, aFont->mFont.size);
|
||||
}
|
||||
// this becomes our cascading size
|
||||
aFont->mSize = aFont->mFont.size =
|
||||
nsStyleFont::ZoomText(aPresContext, aFont->mFont.size);
|
||||
|
||||
aFont->mFont.familyNameQuirks = PR_FALSE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user