Bug 641426. Part 6: Rename Empty to SetEmpty. r=cjones
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 19 Apr 2011 15:07:23 +1200
changeset 68281 91e75937d34ab641eb593651be6f110f3539c181
parent 68280 90e46b3e8e6f973a78280d340b64f8ed4d831624
child 68282 8d64029c1725afde6439212100ffb392df3722ff
push id19571
push userrocallahan@mozilla.com
push dateTue, 19 Apr 2011 03:08:28 +0000
treeherdermozilla-central@fc1ed658bf4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs641426
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 641426. Part 6: Rename Empty to SetEmpty. r=cjones
accessible/src/html/nsHyperTextAccessible.cpp
dom/plugins/ipc/PluginInstanceChild.cpp
gfx/layers/ThebesLayerBuffer.h
gfx/src/nsRect.h
layout/base/nsCaret.cpp
layout/base/nsDisplayList.cpp
layout/forms/nsFieldSetFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsObjectFrame.cpp
layout/svg/base/src/nsSVGGlyphFrame.cpp
layout/svg/base/src/nsSVGImageFrame.cpp
layout/svg/base/src/nsSVGPathGeometryFrame.cpp
layout/tables/nsTablePainter.cpp
modules/libpr0n/src/Decoder.cpp
widget/src/android/AndroidJavaWrappers.cpp
widget/src/cocoa/nsMenuItemIconX.mm
xpfe/appshell/src/nsWebShellWindow.cpp
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -305,17 +305,17 @@ nsHyperTextAccessible::GetPosAndText(PRI
     return nsnull;
   }
 
   nsIFrame *startFrame = nsnull;
   if (aEndFrame) {
     *aEndFrame = nsnull;
   }
   if (aBoundsRect) {
-    aBoundsRect->Empty();
+    aBoundsRect->SetEmpty();
   }
   if (aStartAcc)
     *aStartAcc = nsnull;
   if (aEndAcc)
     *aEndAcc = nsnull;
 
   nsIntRect unionRect;
   nsAccessible *lastAccessible = nsnull;
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2925,17 +2925,17 @@ PluginInstanceChild::ShowPluginFrame()
 
     NS_ASSERTION(mWindow.width == (mWindow.clipRect.right - mWindow.clipRect.left) &&
                  mWindow.height == (mWindow.clipRect.bottom - mWindow.clipRect.top),
                  "Clip rect should be same size as window when using layers");
 
     // Clear accRect here to be able to pass
     // test_invalidate_during_plugin_paint  test
     nsIntRect rect = mAccumulatedInvalidRect;
-    mAccumulatedInvalidRect.Empty();
+    mAccumulatedInvalidRect.SetEmpty();
 
     // Fix up old invalidations that might have been made when our
     // surface was a different size
     gfxIntSize surfaceSize = mCurrentSurface->GetSize();
     rect.IntersectRect(rect,
                        nsIntRect(0, 0, surfaceSize.width, surfaceSize.height));
 
     if (!ReadbackDifferenceRect(rect)) {
--- a/gfx/layers/ThebesLayerBuffer.h
+++ b/gfx/layers/ThebesLayerBuffer.h
@@ -96,17 +96,17 @@ public:
   /**
    * Wipe out all retained contents. Call this when the entire
    * buffer becomes invalid.
    */
   void Clear()
   {
     mBuffer = nsnull;
     mBufferDims.SizeTo(0, 0);
-    mBufferRect.Empty();
+    mBufferRect.SetEmpty();
   }
 
   /**
    * This is returned by BeginPaint. The caller should draw into mContext.
    * mRegionToDraw must be drawn. mRegionToInvalidate has been invalidated
    * by ThebesLayerBuffer and must be redrawn on the screen.
    * mRegionToInvalidate is set when the buffer has changed from
    * opaque to transparent or vice versa, since the details of rendering can
--- a/gfx/src/nsRect.h
+++ b/gfx/src/nsRect.h
@@ -78,17 +78,17 @@ struct NS_GFX nsRect {
   }
 #endif
   
   // Emptiness. An empty rect is one that has no area, i.e. its height or width
   // is <= 0
   PRBool IsEmpty() const {
     return (PRBool) ((height <= 0) || (width <= 0));
   }
-  void   Empty() {width = height = 0;}
+  void SetEmpty() {width = height = 0;}
 
   // Returns true if this rectangle contains the interior of aRect. Always
   // returns true if aRect is empty, and always returns false is aRect is
   // nonempty but this rect is empty.
   PRBool Contains(const nsRect& aRect) const;
   // Returns true if this rectangle contains the given point; if the point
   // is on the edge of the rectangle, this returns true.
   PRBool Contains(nscoord aX, nscoord aY) const;
@@ -116,17 +116,17 @@ struct NS_GFX nsRect {
   PRBool UnionRect(const nsRect& aRect1, const nsRect& aRect2);
 
   // Computes the smallest rectangle that contains both the points (including
   // edges) of both aRect1 and aRect2.
   // Thus, empty input rectangles are allowed to affect the result.
   //
   // 'this' can be the same object as either aRect1 or aRect2
   void UnionRectEdges(const nsRect& aRect1, const nsRect& aRect2);
-  
+
   // Accessors
   void SetRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight) {
     x = aX; y = aY; width = aWidth; height = aHeight;
   }
   void SetRect(const nsPoint& aPt, const nsSize& aSize) {
     SetRect(aPt.x, aPt.y, aSize.width, aSize.height);
   }
   void MoveTo(nscoord aX, nscoord aY) {x = aX; y = aY;}
--- a/layout/base/nsCaret.cpp
+++ b/layout/base/nsCaret.cpp
@@ -1089,17 +1089,17 @@ nsCaret::UpdateCaretRects(nsIFrame* aFra
   }
 
   // on RTL frames the right edge of mCaretRect must be equal to framePos
   const nsStyleVisibility* vis = aFrame->GetStyleVisibility();
   if (NS_STYLE_DIRECTION_RTL == vis->mDirection)
     mCaretRect.x -= mCaretRect.width;
 
 #ifdef IBMBIDI
-  mHookRect.Empty();
+  mHookRect.SetEmpty();
 
   // Simon -- make a hook to draw to the left or right of the caret to show keyboard language direction
   PRBool isCaretRTL = PR_FALSE;
   nsIBidiKeyboard* bidiKeyboard = nsContentUtils::GetBidiKeyboard();
   // if bidiKeyboard->IsLangRTL() fails, there is no way to tell the
   // keyboard direction, or the user has no right-to-left keyboard
   // installed, so we never draw the hook.
   if (bidiKeyboard && NS_SUCCEEDED(bidiKeyboard->IsLangRTL(&isCaretRTL)) &&
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1382,17 +1382,17 @@ ComputeDisjointRectangles(const nsRegion
     if (r && !accumulated.IsEmpty() &&
         accumulated.YMost() >= r->y - accumulationMargin) {
       accumulated.UnionRect(accumulated, *r);
       continue;
     }
 
     if (!accumulated.IsEmpty()) {
       aRects->AppendElement(accumulated);
-      accumulated.Empty();
+      accumulated.SetEmpty();
     }
 
     if (!r)
       break;
 
     accumulated = *r;
   }
 }
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -492,17 +492,17 @@ nsFieldSetFrame::Reflow(nsPresContext*  
     // content area as well.
     if (mLegendSpace != oldSpace && mContentFrame) {
       reflowContent = PR_TRUE;
     }
 
     FinishReflowChild(mLegendFrame, aPresContext, &legendReflowState, 
                       legendDesiredSize, 0, 0, NS_FRAME_NO_MOVE_FRAME);    
   } else if (!mLegendFrame) {
-    mLegendRect.Empty();
+    mLegendRect.SetEmpty();
     mLegendSpace = 0;
   } else {
     // mLegendSpace and mLegendRect haven't changed, but we need
     // the used margin when placing the legend.
     legendMargin = mLegendFrame->GetUsedMargin();
   }
 
   // reflow the content frame only if needed
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1631,17 +1631,17 @@ nsIFrame::BuildDisplayListForChild(nsDis
     nsRect* savedDirty = static_cast<nsRect*>
       (aChild->Properties().Get(nsDisplayListBuilder::OutOfFlowDirtyRectProperty()));
     if (savedDirty) {
       dirty = *savedDirty;
     } else {
       // The out-of-flow frame did not intersect the dirty area. We may still
       // need to traverse into it, since it may contain placeholders we need
       // to enter to reach other out-of-flow frames that are visible.
-      dirty.Empty();
+      dirty.SetEmpty();
     }
     pseudoStackingContext = PR_TRUE;
   } else if (aBuilder->GetSelectedFramesOnly() &&
              aChild->IsLeaf() &&
              !(aChild->GetStateBits() & NS_FRAME_SELECTED_CONTENT)) {
     return NS_OK;
   }
 
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -2946,17 +2946,17 @@ nsObjectFrame::StopPluginInternal(PRBool
   // the plugin. Note that due to that, the ordering of the code in
   // this function is extremely important.
 
   nsRefPtr<nsPluginInstanceOwner> owner;
   owner.swap(mInstanceOwner);
 
   // Make sure that our windowless rect has been zeroed out, so if we
   // get reinstantiated we'll send the right messages to the plug-in.
-  mWindowlessRect.Empty();
+  mWindowlessRect.SetEmpty();
 
   PRBool oldVal = mPreventInstantiation;
   mPreventInstantiation = PR_TRUE;
 
   nsWeakFrame weakFrame(this);
 
 #if defined(XP_WIN) || defined(MOZ_X11)
   if (aDelayedStop && mWidget) {
--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
+++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
@@ -469,17 +469,17 @@ NS_IMETHODIMP_(nsRect)
 nsSVGGlyphFrame::GetCoveredRegion()
 {
   return mRect;
 }
 
 NS_IMETHODIMP
 nsSVGGlyphFrame::UpdateCoveredRegion()
 {
-  mRect.Empty();
+  mRect.SetEmpty();
 
   gfxMatrix matrix = GetCanvasTM();
   if (matrix.IsSingular()) {
     return NS_ERROR_FAILURE;
   }
 
   nsRefPtr<gfxContext> tmpCtx = MakeTmpCtx();
   tmpCtx->Multiply(matrix);
--- a/layout/svg/base/src/nsSVGImageFrame.cpp
+++ b/layout/svg/base/src/nsSVGImageFrame.cpp
@@ -438,17 +438,17 @@ nsSVGImageFrame::GetType() const
 //----------------------------------------------------------------------
 // nsSVGPathGeometryFrame methods:
 
 // Lie about our fill/stroke so that covered region and hit detection work properly
 
 NS_IMETHODIMP
 nsSVGImageFrame::UpdateCoveredRegion()
 {
-  mRect.Empty();
+  mRect.SetEmpty();
 
   gfxContext context(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
 
   GeneratePath(&context);
   context.IdentityMatrix();
 
   gfxRect extent = context.GetUserPathExtent();
 
--- a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
+++ b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
@@ -241,17 +241,17 @@ nsSVGPathGeometryFrame::GetCoveredRegion
   }
 
   return mRect;
 }
 
 NS_IMETHODIMP
 nsSVGPathGeometryFrame::UpdateCoveredRegion()
 {
-  mRect.Empty();
+  mRect.SetEmpty();
 
   nsRefPtr<gfxContext> context =
     new gfxContext(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
 
   GeneratePath(context);
   context->IdentityMatrix();
 
   gfxRect extent = context->GetUserPathExtent();
--- a/layout/tables/nsTablePainter.cpp
+++ b/layout/tables/nsTablePainter.cpp
@@ -156,17 +156,17 @@ TableBackgroundPainter::TableBackgroundD
     mSynthBorder->Destroy(aPresContext);
     mSynthBorder = nsnull;
   }
 }
 
 void
 TableBackgroundPainter::TableBackgroundData::Clear()
 {
-  mRect.Empty();
+  mRect.SetEmpty();
   mFrame = nsnull;
   mBorder = nsnull;
   mVisible = PR_FALSE;
 }
 
 void
 TableBackgroundPainter::TableBackgroundData::SetFrame(nsIFrame* aFrame)
 {
--- a/modules/libpr0n/src/Decoder.cpp
+++ b/modules/libpr0n/src/Decoder.cpp
@@ -170,17 +170,17 @@ Decoder::FlushInvalidations()
 
   // Fire OnDataAvailable
   if (mObserver) {
     PRBool isCurrentFrame = mImage->GetCurrentFrameIndex() == (mFrameCount - 1);
     mObserver->OnDataAvailable(nsnull, isCurrentFrame, &mInvalidRect);
   }
 
   // Clear the invalidation rectangle
-  mInvalidRect.Empty();
+  mInvalidRect.SetEmpty();
 }
 
 /*
  * Hook stubs. Override these as necessary in decoder implementations.
  */
 
 void Decoder::InitInternal() { }
 void Decoder::WriteInternal(const char* aBuffer, PRUint32 aCount) { }
--- a/widget/src/android/AndroidJavaWrappers.cpp
+++ b/widget/src/android/AndroidJavaWrappers.cpp
@@ -316,17 +316,17 @@ AndroidGeckoEvent::ReadRectField(JNIEnv 
 {
     AndroidRect r(jenv, jenv->GetObjectField(wrappedObject(), jRectField));
     if (!r.isNull()) {
         mRect.SetRect(r.Left(),
                       r.Top(),
                       r.Right() - r.Left(),
                       r.Bottom() - r.Top());
     } else {
-        mRect.Empty();
+        mRect.SetEmpty();
     }
 }
 
 void
 AndroidGeckoEvent::ReadCharactersField(JNIEnv *jenv)
 {
     jstring s = (jstring) jenv->GetObjectField(wrapped_obj, jCharactersField);
     if (!s) {
@@ -433,17 +433,17 @@ AndroidGeckoEvent::Init(int aType)
 {
     mType = aType;
 }
 
 void
 AndroidGeckoEvent::Init(int x1, int y1, int x2, int y2)
 {
     mType = DRAW;
-    mRect.Empty();
+    mRect.SetEmpty();
 }
 
 void
 AndroidGeckoSurfaceView::Init(jobject jobj)
 {
     NS_ASSERTION(wrapped_obj == nsnull, "Init called on non-null wrapped_obj!");
 
     wrapped_obj = jobj;
--- a/widget/src/cocoa/nsMenuItemIconX.mm
+++ b/widget/src/cocoa/nsMenuItemIconX.mm
@@ -235,17 +235,17 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIc
 
     rv = primitiveValue->GetStringValue(imageURIString);
     if (NS_FAILED(rv)) return rv;
   }
 
   // Empty the mImageRegionRect initially as the image region CSS could
   // have been changed and now have an error or have been removed since the
   // last GetIconURI call.
-  mImageRegionRect.Empty();
+  mImageRegionRect.SetEmpty();
 
   // If this menu item shouldn't have an icon, the string will be empty,
   // and NS_NewURI will fail.
   nsCOMPtr<nsIURI> iconURI;
   rv = NS_NewURI(getter_AddRefs(iconURI), imageURIString);
   if (NS_FAILED(rv)) return rv;
 
   *aIconURI = iconURI;
--- a/xpfe/appshell/src/nsWebShellWindow.cpp
+++ b/xpfe/appshell/src/nsWebShellWindow.cpp
@@ -165,17 +165,17 @@ nsresult nsWebShellWindow::Initialize(ns
   PRInt32 initialX = 0, initialY = 0;
   nsCOMPtr<nsIBaseWindow> base(do_QueryInterface(aOpener));
   if (base) {
     rv = base->GetPositionAndSize(&mOpenerScreenRect.x,
                                   &mOpenerScreenRect.y,
                                   &mOpenerScreenRect.width,
                                   &mOpenerScreenRect.height);
     if (NS_FAILED(rv)) {
-      mOpenerScreenRect.Empty();
+      mOpenerScreenRect.SetEmpty();
     } else {
       initialX = mOpenerScreenRect.x;
       initialY = mOpenerScreenRect.y;
       ConstrainToOpenerScreen(&initialX, &initialY);
     }
   }
 
   // XXX: need to get the default window size from prefs...