Bug 817774 - Let nsIntRect not have a nsIntRect static data member, as that kills GDB printing it - r=dholbert
☠☠ backed out by 6493a073d5ca ☠ ☠
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 17 Dec 2012 16:59:53 -0500
changeset 121893 97061a5509355424f622279a0d4464a01bf77780
parent 121892 852237e60012814caca184adb2692127eeb94f81
child 121894 585a5af3a0a54f14705026ed5008fe8d8e9e336a
push idunknown
push userunknown
push dateunknown
reviewersdholbert
bugs817774
milestone20.0a1
Bug 817774 - Let nsIntRect not have a nsIntRect static data member, as that kills GDB printing it - r=dholbert
gfx/src/nsRect.cpp
gfx/src/nsRect.h
--- a/gfx/src/nsRect.cpp
+++ b/gfx/src/nsRect.cpp
@@ -7,19 +7,16 @@
 #include "nsString.h"
 #include "nsDeviceContext.h"
 #include "prlog.h"
 #include <limits.h>
 
 // the mozilla::css::Side sequence must match the nsMargin nscoord sequence
 PR_STATIC_ASSERT((NS_SIDE_TOP == 0) && (NS_SIDE_RIGHT == 1) && (NS_SIDE_BOTTOM == 2) && (NS_SIDE_LEFT == 3));
 
-/* static */
-const nsIntRect nsIntRect::kMaxSizedIntRect(0, 0, INT_MAX, INT_MAX);
-
 #ifdef DEBUG
 // Diagnostics
 
 FILE* operator<<(FILE* out, const nsRect& rect)
 {
   nsAutoString tmp;
 
   // Output the coordinates in fractional pixels so they're easier to read
--- a/gfx/src/nsRect.h
+++ b/gfx/src/nsRect.h
@@ -226,26 +226,26 @@ struct NS_GFX nsIntRect :
       Super(aX, aY, aWidth, aHeight)
   {
   }
 
   inline nsRect ToAppUnits(nscoord aAppUnitsPerPixel) const;
 
   // Returns a special nsIntRect that's used in some places to signify
   // "all available space".
-  static const nsIntRect& GetMaxSizedIntRect() { return kMaxSizedIntRect; }
+  static const nsIntRect& GetMaxSizedIntRect() {
+    static const nsIntRect r(0, 0, INT_MAX, INT_MAX);
+    return r;
+  }
 
   // This is here only to keep IPDL-generated code happy. DO NOT USE.
   bool operator==(const nsIntRect& aRect) const
   {
     return IsEqualEdges(aRect);
   }
-
-protected:
-  static const nsIntRect kMaxSizedIntRect;
 };
 
 /*
  * App Unit/Pixel conversions
  */
 
 inline nsRect
 nsRect::ConvertAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const