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:
@@ -1410,24 +1410,17 @@ nsTextControlFrame::ReflowStandard(nsIPresContext* aPresContext,
|
||||
float p2t;
|
||||
aPresContext->GetPixelsToTwips(&p2t);
|
||||
|
||||
nscoord scrollbarWidth = 0;
|
||||
nscoord scrollbarHeight = 0;
|
||||
nsCOMPtr<nsIDeviceContext> dx;
|
||||
aPresContext->GetDeviceContext(getter_AddRefs(dx));
|
||||
if (dx) {
|
||||
float scale;
|
||||
dx->GetCanonicalPixelScale(scale);
|
||||
nsIDeviceContext *dx = aPresContext->DeviceContext();
|
||||
|
||||
float sbWidth;
|
||||
float sbHeight;
|
||||
dx->GetScrollBarDimensions(sbWidth, sbHeight);
|
||||
scrollbarWidth = PRInt32(sbWidth * scale);
|
||||
scrollbarHeight = PRInt32(sbHeight * scale);
|
||||
} else {
|
||||
NS_WARNING("Dude! No DeviceContext! Not cool!");
|
||||
scrollbarWidth = nsFormControlFrame::GetScrollbarWidth(p2t);
|
||||
scrollbarHeight = scrollbarWidth;
|
||||
}
|
||||
float scale;
|
||||
dx->GetCanonicalPixelScale(scale);
|
||||
|
||||
float sbWidth;
|
||||
float sbHeight;
|
||||
dx->GetScrollBarDimensions(sbWidth, sbHeight);
|
||||
|
||||
nscoord scrollbarWidth = PRInt32(sbWidth * scale);
|
||||
nscoord scrollbarHeight = PRInt32(sbHeight * scale);
|
||||
|
||||
aDesiredSize.height += scrollbarHeight;
|
||||
minSize.height += scrollbarHeight;
|
||||
|
||||
Reference in New Issue
Block a user