Bug 786533 - Replace NS_MIN/NS_MAX with std::min/std::max and #include <algorithm> where needed. r=ehsan

This commit is contained in:
Mats Palmgren
2013-01-15 13:22:03 +01:00
parent 9f4749fbb5
commit 7532b4e736
337 changed files with 1739 additions and 1410 deletions

View File

@@ -30,6 +30,7 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsStyleSet.h"
#include "nsDisplayList.h"
#include <algorithm>
using namespace mozilla;
@@ -276,12 +277,12 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
NS_ASSERTION(extraright >=0, "How'd that happen?");
// Do not allow the extras to be bigger than the relevant padding
extraleft = NS_MIN(extraleft, aReflowState.mComputedPadding.left);
extraright = NS_MIN(extraright, aReflowState.mComputedPadding.right);
extraleft = std::min(extraleft, aReflowState.mComputedPadding.left);
extraright = std::min(extraright, aReflowState.mComputedPadding.right);
xoffset -= extraleft;
availSize.width += extraleft + extraright;
}
availSize.width = NS_MAX(availSize.width,0);
availSize.width = std::max(availSize.width,0);
nsHTMLReflowState reflowState(aPresContext, aReflowState, aFirstKid,
availSize);
@@ -295,7 +296,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
// XXXbz this assumes border-box sizing.
nscoord minInternalHeight = aReflowState.mComputedMinHeight -
aReflowState.mComputedBorderPadding.TopBottom();
minInternalHeight = NS_MAX(minInternalHeight, 0);
minInternalHeight = std::max(minInternalHeight, 0);
// center child vertically
nscoord yoff = 0;