Bug 382471. Don't crash when wigets aren't present. patch by Eli Friedman, r+sr=roc
authorroc+@cs.cmu.edu
Thu, 31 May 2007 16:23:32 -0700
changeset 2048 3eaa31dc69509f950fe45d1c21681c7335c75af2
parent 2047 b1918c2beed5397381f8658714220e5f342eda50
child 2049 2f634ff9b3f0050d20771df4ea215f3d9c3928e6
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs382471
milestone1.9a5pre
Bug 382471. Don't crash when wigets aren't present. patch by Eli Friedman, r+sr=roc
view/src/nsView.cpp
--- a/view/src/nsView.cpp
+++ b/view/src/nsView.cpp
@@ -351,17 +351,17 @@ nsRect nsView::CalcWidgetBounds(nsWindow
   nsRect viewBounds(mDimBounds);
 
   if (GetParent()) {
     // put offset into screen coordinates
     nsPoint offset;
     nsIWidget* parentWidget = GetParent()->GetNearestWidget(&offset);
     viewBounds += offset;
 
-    if (parentWidget && Type == eWindowType_popup &&
+    if (parentWidget && aType == eWindowType_popup &&
         mVis == nsViewVisibility_kShow) {
       nsRect screenRect(0,0,1,1);
       parentWidget->WidgetToScreen(screenRect, screenRect);
       viewBounds += nsPoint(NSIntPixelsToAppUnits(screenRect.x, p2a),
                             NSIntPixelsToAppUnits(screenRect.y, p2a));
     }
   }