mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Clean up prbool misuse in layout. bug 398312, r+sr+a=dbaron
This commit is contained in:
parent
ac490cdd0b
commit
8cf3fb1c90
@ -1359,7 +1359,7 @@ nsresult nsBidiPresUtils::ProcessText(const PRUnichar* aText,
|
||||
|
||||
PRUint32 hints = 0;
|
||||
aRenderingContext.GetHints(hints);
|
||||
PRBool isBidiSystem = (hints & NS_RENDERING_HINT_BIDI_REORDERING);
|
||||
PRBool isBidiSystem = !!(hints & NS_RENDERING_HINT_BIDI_REORDERING);
|
||||
|
||||
for(int nPosResolve=0; nPosResolve < aPosResolveCount; ++nPosResolve)
|
||||
{
|
||||
@ -1407,7 +1407,7 @@ nsresult nsBidiPresUtils::ProcessText(const PRUnichar* aText,
|
||||
CalculateCharType(lineOffset, typeLimit, subRunLimit, subRunLength, subRunCount, charType, prevType);
|
||||
|
||||
if (eCharType_RightToLeftArabic == charType) {
|
||||
isBidiSystem = (hints & NS_RENDERING_HINT_ARABIC_SHAPING);
|
||||
isBidiSystem = !!(hints & NS_RENDERING_HINT_ARABIC_SHAPING);
|
||||
}
|
||||
if (isBidiSystem && (CHARTYPE_IS_RTL(charType) ^ isRTL) ) {
|
||||
// set reading order into DC
|
||||
|
@ -4129,7 +4129,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
|
||||
PRBool horizontal = ((NS_SIDE_TOP == aStartBevelSide) || (NS_SIDE_BOTTOM == aStartBevelSide));
|
||||
nscoord twipsPerPixel = NSIntPixelsToAppUnits(1, aAppUnitsPerCSSPixel);
|
||||
PRBool ridgeGroove = NS_STYLE_BORDER_STYLE_RIDGE;
|
||||
PRUint8 ridgeGroove = NS_STYLE_BORDER_STYLE_RIDGE;
|
||||
|
||||
if ((twipsPerPixel >= aBorder.width) || (twipsPerPixel >= aBorder.height) ||
|
||||
(NS_STYLE_BORDER_STYLE_DASHED == aBorderStyle) || (NS_STYLE_BORDER_STYLE_DOTTED == aBorderStyle)) {
|
||||
|
@ -592,7 +592,7 @@ nsCaret::DrawAtPositionWithHint(nsIDOMNode* aNode,
|
||||
if (aBidiLevel & BIDI_LEVEL_UNDEFINED) {
|
||||
nsFrameSelection* frameSelection = GetFrameSelection();
|
||||
if (!frameSelection)
|
||||
return NS_ERROR_FAILURE;
|
||||
return PR_FALSE;
|
||||
frameSelection->SetCaretBidiLevel(NS_GET_EMBEDDING_LEVEL(theFrame));
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ nsGenConList::DestroyNodesFor(nsIFrame* aFrame)
|
||||
}
|
||||
|
||||
// return -1 for ::before, +1 for ::after, and 0 otherwise.
|
||||
inline PRBool PseudoCompareType(nsIFrame *aFrame)
|
||||
inline PRInt32 PseudoCompareType(nsIFrame *aFrame)
|
||||
{
|
||||
nsIAtom *pseudo = aFrame->GetStyleContext()->GetPseudoType();
|
||||
if (pseudo == nsCSSPseudoElements::before)
|
||||
|
@ -286,9 +286,7 @@ public:
|
||||
PRBool GetFlag(PRUint32 aFlag) const
|
||||
{
|
||||
NS_ASSERTION(aFlag<=BRS_LASTFLAG, "bad flag");
|
||||
PRBool result = (mFlags & aFlag);
|
||||
if (result) return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
return !!(mFlags & aFlag);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -290,7 +290,7 @@ nsBulletFrame::PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt,
|
||||
|
||||
case NS_STYLE_LIST_STYLE_HEBREW:
|
||||
aRenderingContext.GetHints(hints);
|
||||
isBidiSystem = (hints & NS_RENDERING_HINT_BIDI_REORDERING);
|
||||
isBidiSystem = !!(hints & NS_RENDERING_HINT_BIDI_REORDERING);
|
||||
if (!isBidiSystem) {
|
||||
if (GetListItemText(*myList, text)) {
|
||||
charType = eCharType_RightToLeft;
|
||||
@ -401,7 +401,7 @@ nsBulletFrame::PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt,
|
||||
else {
|
||||
//Mohamed
|
||||
aRenderingContext.GetHints(hints);
|
||||
isBidiSystem = (hints & NS_RENDERING_HINT_ARABIC_SHAPING);
|
||||
isBidiSystem = !!(hints & NS_RENDERING_HINT_ARABIC_SHAPING);
|
||||
bidiUtils->FormatUnicodeText(presContext, (PRUnichar*)buffer, textLength,
|
||||
charType, level, isBidiSystem, isNewTextRunSystem);//Mohamed
|
||||
}
|
||||
|
@ -4108,7 +4108,7 @@ nsFrame::GetSelected(PRBool *aSelected) const
|
||||
{
|
||||
if (!aSelected )
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
*aSelected = (PRBool)(mState & NS_FRAME_SELECTED_CONTENT);
|
||||
*aSelected = !!(mState & NS_FRAME_SELECTED_CONTENT);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -6758,7 +6758,7 @@ DR_Rule* DR_State::ParseRule(FILE* aFile)
|
||||
while (GetToken(aFile, buf)) {
|
||||
if (GetNumber(buf, doDisplay)) {
|
||||
if (rule) {
|
||||
rule->mDisplay = (PRBool)doDisplay;
|
||||
rule->mDisplay = !!doDisplay;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
@ -1430,7 +1430,7 @@ public:
|
||||
*
|
||||
* GetView returns non-null if and only if |HasView| returns true.
|
||||
*/
|
||||
PRBool HasView() const { return mState & NS_FRAME_HAS_VIEW; }
|
||||
PRBool HasView() const { return !!(mState & NS_FRAME_HAS_VIEW); }
|
||||
nsIView* GetView() const;
|
||||
virtual nsIView* GetViewExternal() const;
|
||||
nsresult SetView(nsIView* aView);
|
||||
|
@ -138,7 +138,7 @@ public:
|
||||
// If the frame's bidi visual state is set, return is-leftmost state
|
||||
// else return true if it's the first continuation.
|
||||
return (GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET)
|
||||
? (GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_IS_LEFT_MOST)
|
||||
? !!(GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_IS_LEFT_MOST)
|
||||
: (!GetPrevInFlow());
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ public:
|
||||
// If the frame's bidi visual state is set, return is-rightmost state
|
||||
// else return true if it's the last continuation.
|
||||
return (GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET)
|
||||
? (GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_IS_RIGHT_MOST)
|
||||
? !!(GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_IS_RIGHT_MOST)
|
||||
: (!GetNextInFlow());
|
||||
}
|
||||
|
||||
|
@ -166,9 +166,7 @@ protected:
|
||||
PRBool GetFlag(PRUint32 aFlag) const
|
||||
{
|
||||
NS_ASSERTION(aFlag<=LL_LASTFLAG, "bad flag");
|
||||
PRBool result = (mFlags & aFlag);
|
||||
if (result) return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
return !!(mFlags & aFlag);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -447,9 +445,7 @@ protected:
|
||||
PRBool GetFlag(PRUint32 aFlag) const
|
||||
{
|
||||
NS_ASSERTION(aFlag<=PFD_LASTFLAG, "bad flag");
|
||||
PRBool result = (mFlags & aFlag);
|
||||
if (result) return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
return !!(mFlags & aFlag);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1099,7 +1099,7 @@ nsFrameSelection::SetCaretBidiLevel(PRUint8 aLevel)
|
||||
{
|
||||
// If the current level is undefined, we have just inserted new text.
|
||||
// In this case, we don't want to reset the keyboard language
|
||||
PRBool afterInsert = mCaretBidiLevel & BIDI_LEVEL_UNDEFINED;
|
||||
PRBool afterInsert = !!(mCaretBidiLevel & BIDI_LEVEL_UNDEFINED);
|
||||
mCaretBidiLevel = aLevel;
|
||||
|
||||
nsIBidiKeyboard* bidiKeyboard = nsContentUtils::GetBidiKeyboard();
|
||||
|
@ -107,7 +107,7 @@ public:
|
||||
FindChildWithRules(const nsIAtom* aPseudoTag, nsRuleNode* aRules);
|
||||
|
||||
NS_HIDDEN_(PRBool) Equals(const nsStyleContext* aOther) const;
|
||||
PRBool HasTextDecorations() { return mBits & NS_STYLE_HAS_TEXT_DECORATIONS; }
|
||||
PRBool HasTextDecorations() { return !!(mBits & NS_STYLE_HAS_TEXT_DECORATIONS); }
|
||||
|
||||
NS_HIDDEN_(void) SetStyle(nsStyleStructID aSID, nsStyleStruct* aStruct);
|
||||
|
||||
|
@ -579,7 +579,7 @@ struct nsStyleOutline: public nsStyleStruct {
|
||||
|
||||
PRBool GetOutlineInitialColor() const
|
||||
{
|
||||
return (mOutlineStyle & OUTLINE_COLOR_INITIAL);
|
||||
return !!(mOutlineStyle & OUTLINE_COLOR_INITIAL);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -1268,7 +1268,7 @@ nsSVGGlyphFrame::ContainsPoint(float x, float y)
|
||||
gfxContext *gfx = ctx.GetContext();
|
||||
gfxTextRun *textRun = ctx.GetTextRun();
|
||||
if (!gfx || !textRun)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
return PR_FALSE;
|
||||
|
||||
nsresult rv = GetGlobalTransform(gfx);
|
||||
NS_ENSURE_SUCCESS(rv, PR_FALSE);
|
||||
|
@ -854,7 +854,7 @@ nsSVGPatternFrame::SetupPaintServer(gfxContext *aContext,
|
||||
}
|
||||
|
||||
if (pMatrix.IsSingular()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
pMatrix.Invert();
|
||||
@ -862,7 +862,7 @@ nsSVGPatternFrame::SetupPaintServer(gfxContext *aContext,
|
||||
nsRefPtr<gfxPattern> pattern = new gfxPattern(surface);
|
||||
|
||||
if (!pattern)
|
||||
return NS_ERROR_FAILURE;
|
||||
return PR_FALSE;
|
||||
|
||||
pattern->SetMatrix(pMatrix);
|
||||
pattern->SetExtend(gfxPattern::EXTEND_REPEAT);
|
||||
|
@ -300,7 +300,7 @@ nsBoxFrame::CacheAttributes()
|
||||
else
|
||||
mState &= ~NS_STATE_EQUAL_SIZE;
|
||||
|
||||
PRBool autostretch = mState & NS_STATE_AUTO_STRETCH;
|
||||
PRBool autostretch = !!(mState & NS_STATE_AUTO_STRETCH);
|
||||
GetInitialAutoStretch(autostretch);
|
||||
if (autostretch)
|
||||
mState |= NS_STATE_AUTO_STRETCH;
|
||||
@ -1170,7 +1170,7 @@ nsBoxFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
}
|
||||
#endif
|
||||
|
||||
PRBool autostretch = mState & NS_STATE_AUTO_STRETCH;
|
||||
PRBool autostretch = !!(mState & NS_STATE_AUTO_STRETCH);
|
||||
GetInitialAutoStretch(autostretch);
|
||||
if (autostretch)
|
||||
mState |= NS_STATE_AUTO_STRETCH;
|
||||
|
@ -1324,7 +1324,7 @@ nsSprocketLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aS
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsFrameState frameState = 0;
|
||||
GetFrameState(aBox, frameState);
|
||||
PRBool isEqual = frameState & NS_STATE_EQUAL_SIZE;
|
||||
PRBool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
|
||||
PRInt32 count = 0;
|
||||
|
||||
while (child)
|
||||
@ -1382,7 +1382,7 @@ nsSprocketLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aSi
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsFrameState frameState = 0;
|
||||
GetFrameState(aBox, frameState);
|
||||
PRBool isEqual = frameState & NS_STATE_EQUAL_SIZE;
|
||||
PRBool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
|
||||
PRInt32 count = 0;
|
||||
|
||||
while (child)
|
||||
@ -1453,7 +1453,7 @@ nsSprocketLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aSi
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsFrameState frameState = 0;
|
||||
GetFrameState(aBox, frameState);
|
||||
PRBool isEqual = frameState & NS_STATE_EQUAL_SIZE;
|
||||
PRBool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
|
||||
PRInt32 count = 0;
|
||||
|
||||
while (child)
|
||||
|
@ -87,17 +87,17 @@ class Row
|
||||
void SetOpen(PRBool aOpen) {
|
||||
aOpen ? mFlags |= ROW_FLAG_OPEN : mFlags &= ~ROW_FLAG_OPEN;
|
||||
}
|
||||
PRBool IsOpen() { return mFlags & ROW_FLAG_OPEN; }
|
||||
PRBool IsOpen() { return !!(mFlags & ROW_FLAG_OPEN); }
|
||||
|
||||
void SetEmpty(PRBool aEmpty) {
|
||||
aEmpty ? mFlags |= ROW_FLAG_EMPTY : mFlags &= ~ROW_FLAG_EMPTY;
|
||||
}
|
||||
PRBool IsEmpty() { return mFlags & ROW_FLAG_EMPTY; }
|
||||
PRBool IsEmpty() { return !!(mFlags & ROW_FLAG_EMPTY); }
|
||||
|
||||
void SetSeparator(PRBool aSeparator) {
|
||||
aSeparator ? mFlags |= ROW_FLAG_SEPARATOR : mFlags &= ~ROW_FLAG_SEPARATOR;
|
||||
}
|
||||
PRBool IsSeparator() { return mFlags & ROW_FLAG_SEPARATOR; }
|
||||
PRBool IsSeparator() { return !!(mFlags & ROW_FLAG_SEPARATOR); }
|
||||
|
||||
// Weak reference to a content item.
|
||||
nsIContent* mContent;
|
||||
|
Loading…
Reference in New Issue
Block a user