diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index d963f39b235..690925712f4 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -4415,7 +4415,7 @@ NS_IMETHODIMP PresShell::GetLinkLocation(nsIDOMNode* aNode, nsAString& aLocation } } - if (anchor || area || link || xlinkType.Equals(NS_LITERAL_STRING("simple"))) { + if (anchor || area || link || xlinkType.EqualsLiteral("simple")) { //Remove all the '\t', '\r' and '\n' from 'anchorText' anchorText.StripChars(strippedChars); diff --git a/mozilla/layout/build/nsContentDLF.cpp b/mozilla/layout/build/nsContentDLF.cpp index 6852f66dc39..3d9410ccc00 100644 --- a/mozilla/layout/build/nsContentDLF.cpp +++ b/mozilla/layout/build/nsContentDLF.cpp @@ -179,7 +179,7 @@ nsContentDLF::CreateInstance(const char* aCommand, PRInt32 typeIndex; for (typeIndex = 0; gHTMLTypes[typeIndex] && !knownType; ++typeIndex) { if (type.Equals(gHTMLTypes[typeIndex]) && - !type.Equals(NS_LITERAL_CSTRING("application/x-view-source"))) { + !type.EqualsLiteral("application/x-view-source")) { knownType = PR_TRUE; } } diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 7327be77db2..e83b58f0a3b 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -1032,7 +1032,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, else { // otherwise, we're either an ActiveX control or an internal widget // These are some builtin types that we know about for now. // (Eventually this will move somewhere else.) - if (classid.Equals(NS_LITERAL_STRING("browser"))) { + if (classid.EqualsLiteral("browser")) { rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, kCAppShellCID); } diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index 7327be77db2..e83b58f0a3b 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -1032,7 +1032,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, else { // otherwise, we're either an ActiveX control or an internal widget // These are some builtin types that we know about for now. // (Eventually this will move somewhere else.) - if (classid.Equals(NS_LITERAL_STRING("browser"))) { + if (classid.EqualsLiteral("browser")) { rv = InstantiateWidget(aPresContext, aMetrics, aReflowState, kCAppShellCID); } diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index d963f39b235..690925712f4 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -4415,7 +4415,7 @@ NS_IMETHODIMP PresShell::GetLinkLocation(nsIDOMNode* aNode, nsAString& aLocation } } - if (anchor || area || link || xlinkType.Equals(NS_LITERAL_STRING("simple"))) { + if (anchor || area || link || xlinkType.EqualsLiteral("simple")) { //Remove all the '\t', '\r' and '\n' from 'anchorText' anchorText.StripChars(strippedChars); diff --git a/mozilla/layout/html/tests/TestAttributes.cpp b/mozilla/layout/html/tests/TestAttributes.cpp index 256b571a440..c5247fe87da 100644 --- a/mozilla/layout/html/tests/TestAttributes.cpp +++ b/mozilla/layout/html/tests/TestAttributes.cpp @@ -124,19 +124,19 @@ void testStrings(nsIDocument* aDoc) { PRBool val; // regular Equals - val = (NS_ConvertASCIItoUCS2("mrString")).Equals(NS_LITERAL_STRING("mrString")); // XXXjag + val = (NS_ConvertASCIItoUCS2("mrString")).EqualsLiteral("mrString"); // XXXjag if (PR_TRUE != val) { printf("test 0 failed\n"); } - val = (NS_ConvertASCIItoUCS2("mrString")).Equals(NS_LITERAL_STRING("MRString")); // XXXjag + val = (NS_ConvertASCIItoUCS2("mrString")).EqualsLiteral("MRString"); // XXXjag if (PR_FALSE != val) { printf("test 1 failed\n"); } - val = (NS_ConvertASCIItoUCS2("mrString")).Equals(NS_LITERAL_STRING("mrStri")); // XXXjag + val = (NS_ConvertASCIItoUCS2("mrString")).EqualsLiteral("mrStri"); // XXXjag if (PR_FALSE != val) { printf("test 2 failed\n"); } - val = (NS_ConvertASCIItoUCS2("mrStri")).Equals(NS_LITERAL_STRING("mrString")); // XXXjag + val = (NS_ConvertASCIItoUCS2("mrStri")).EqualsLiteral("mrString"); // XXXjag if (PR_FALSE != val) { printf("test 3 failed\n"); } diff --git a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp index e8e716ce51d..1cdd4a5c8e5 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp @@ -385,18 +385,18 @@ nsMathMLFrame::ParseNumericValue(nsString& aString, if (unit.IsEmpty()) { cssUnit = eCSSUnit_Number; // no explicit unit, this is a number that will act as a multiplier } - else if (unit.Equals(NS_LITERAL_STRING("%"))) { + else if (unit.EqualsLiteral("%")) { aCSSValue.SetPercentValue(floatValue / 100.0f); return PR_TRUE; } - else if (unit.Equals(NS_LITERAL_STRING("em"))) cssUnit = eCSSUnit_EM; - else if (unit.Equals(NS_LITERAL_STRING("ex"))) cssUnit = eCSSUnit_XHeight; - else if (unit.Equals(NS_LITERAL_STRING("px"))) cssUnit = eCSSUnit_Pixel; - else if (unit.Equals(NS_LITERAL_STRING("in"))) cssUnit = eCSSUnit_Inch; - else if (unit.Equals(NS_LITERAL_STRING("cm"))) cssUnit = eCSSUnit_Centimeter; - else if (unit.Equals(NS_LITERAL_STRING("mm"))) cssUnit = eCSSUnit_Millimeter; - else if (unit.Equals(NS_LITERAL_STRING("pt"))) cssUnit = eCSSUnit_Point; - else if (unit.Equals(NS_LITERAL_STRING("pc"))) cssUnit = eCSSUnit_Pica; + else if (unit.EqualsLiteral("em")) cssUnit = eCSSUnit_EM; + else if (unit.EqualsLiteral("ex")) cssUnit = eCSSUnit_XHeight; + else if (unit.EqualsLiteral("px")) cssUnit = eCSSUnit_Pixel; + else if (unit.EqualsLiteral("in")) cssUnit = eCSSUnit_Inch; + else if (unit.EqualsLiteral("cm")) cssUnit = eCSSUnit_Centimeter; + else if (unit.EqualsLiteral("mm")) cssUnit = eCSSUnit_Millimeter; + else if (unit.EqualsLiteral("pt")) cssUnit = eCSSUnit_Point; + else if (unit.EqualsLiteral("pc")) cssUnit = eCSSUnit_Pica; else // unexpected unit return PR_FALSE; @@ -450,31 +450,31 @@ nsMathMLFrame::ParseNamedSpaceValue(nsIFrame* aMathMLmstyleFrame, // See if it is one of the 'namedspace' (ranging 1/18em...7/18em) PRInt32 i = 0; nsIAtom* namedspaceAtom = nsnull; - if (aString.Equals(NS_LITERAL_STRING("veryverythinmathspace"))) { + if (aString.EqualsLiteral("veryverythinmathspace")) { i = 1; namedspaceAtom = nsMathMLAtoms::veryverythinmathspace_; } - else if (aString.Equals(NS_LITERAL_STRING("verythinmathspace"))) { + else if (aString.EqualsLiteral("verythinmathspace")) { i = 2; namedspaceAtom = nsMathMLAtoms::verythinmathspace_; } - else if (aString.Equals(NS_LITERAL_STRING("thinmathspace"))) { + else if (aString.EqualsLiteral("thinmathspace")) { i = 3; namedspaceAtom = nsMathMLAtoms::thinmathspace_; } - else if (aString.Equals(NS_LITERAL_STRING("mediummathspace"))) { + else if (aString.EqualsLiteral("mediummathspace")) { i = 4; namedspaceAtom = nsMathMLAtoms::mediummathspace_; } - else if (aString.Equals(NS_LITERAL_STRING("thickmathspace"))) { + else if (aString.EqualsLiteral("thickmathspace")) { i = 5; namedspaceAtom = nsMathMLAtoms::thickmathspace_; } - else if (aString.Equals(NS_LITERAL_STRING("verythickmathspace"))) { + else if (aString.EqualsLiteral("verythickmathspace")) { i = 6; namedspaceAtom = nsMathMLAtoms::verythickmathspace_; } - else if (aString.Equals(NS_LITERAL_STRING("veryverythickmathspace"))) { + else if (aString.EqualsLiteral("veryverythickmathspace")) { i = 7; namedspaceAtom = nsMathMLAtoms::veryverythickmathspace_; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp index 99427332160..2063eb67f4c 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp @@ -126,7 +126,7 @@ nsMathMLmactionFrame::Init(nsIPresContext* aPresContext, mActionType = NS_MATHML_ACTION_TYPE_NONE; if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::actiontype_, value)) { - if (value.Equals(NS_LITERAL_STRING("toggle"))) + if (value.EqualsLiteral("toggle")) mActionType = NS_MATHML_ACTION_TYPE_TOGGLE; // XXX use goto to jump out of these if? diff --git a/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp index e58f6768cf3..fb1cee8cb16 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmfracFrame.cpp @@ -104,7 +104,7 @@ nsMathMLmfracFrame::IsBevelled() if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::bevelled_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) { + if (value.EqualsLiteral("true")) { return PR_TRUE; } } @@ -178,21 +178,21 @@ nsMathMLmfracFrame::CalcLineThickness(nsIPresContext* aPresContext, nscoord minimumThickness = onePixel; if (!aThicknessAttribute.IsEmpty()) { - if (aThicknessAttribute.Equals(NS_LITERAL_STRING("thin"))) { + if (aThicknessAttribute.EqualsLiteral("thin")) { lineThickness = NSToCoordFloor(defaultThickness * THIN_FRACTION_LINE); minimumThickness = onePixel * THIN_FRACTION_LINE_MINIMUM_PIXELS; // should visually decrease by at least one pixel, if default is not a pixel if (defaultThickness > onePixel && lineThickness > defaultThickness - onePixel) lineThickness = defaultThickness - onePixel; } - else if (aThicknessAttribute.Equals(NS_LITERAL_STRING("medium"))) { + else if (aThicknessAttribute.EqualsLiteral("medium")) { lineThickness = NSToCoordRound(defaultThickness * MEDIUM_FRACTION_LINE); minimumThickness = onePixel * MEDIUM_FRACTION_LINE_MINIMUM_PIXELS; // should visually increase by at least one pixel if (lineThickness < defaultThickness + onePixel) lineThickness = defaultThickness + onePixel; } - else if (aThicknessAttribute.Equals(NS_LITERAL_STRING("thick"))) { + else if (aThicknessAttribute.EqualsLiteral("thick")) { lineThickness = NSToCoordCeil(defaultThickness * THICK_FRACTION_LINE); minimumThickness = onePixel * THICK_FRACTION_LINE_MINIMUM_PIXELS; // should visually increase by at least two pixels @@ -402,17 +402,17 @@ nsMathMLmfracFrame::Place(nsIPresContext* aPresContext, // see if the numalign attribute is there if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::numalign_, value)) { - if (value.Equals(NS_LITERAL_STRING("left"))) + if (value.EqualsLiteral("left")) dxNum = leftSpace; - else if (value.Equals(NS_LITERAL_STRING("right"))) + else if (value.EqualsLiteral("right")) dxNum = width - rightSpace - sizeNum.width; } // see if the denomalign attribute is there if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::denomalign_, value)) { - if (value.Equals(NS_LITERAL_STRING("left"))) + if (value.EqualsLiteral("left")) dxDen = leftSpace; - else if (value.Equals(NS_LITERAL_STRING("right"))) + else if (value.EqualsLiteral("right")) dxDen = width - rightSpace - sizeDen.width; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp index d98ccec6e5e..cf4ba5ddbf5 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp @@ -344,17 +344,17 @@ nsMathMLmoFrame::ProcessOperatorData(nsIPresContext* aPresContext) // see if the accent attribute is there if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::accent_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) mEmbellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value.Equals(NS_LITERAL_STRING("false"))) + else if (value.EqualsLiteral("false")) mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; } // see if the movablelimits attribute is there if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::movablelimits_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) mEmbellishData.flags |= NS_MATHML_EMBELLISH_MOVABLELIMITS; - else if (value.Equals(NS_LITERAL_STRING("false"))) + else if (value.EqualsLiteral("false")) mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_MOVABLELIMITS; } @@ -406,9 +406,9 @@ nsMathMLmoFrame::ProcessOperatorData(nsIPresContext* aPresContext) form = NS_MATHML_OPERATOR_FORM_INFIX; if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::form_, value)) { - if (value.Equals(NS_LITERAL_STRING("prefix"))) + if (value.EqualsLiteral("prefix")) form = NS_MATHML_OPERATOR_FORM_PREFIX; - else if (value.Equals(NS_LITERAL_STRING("postfix"))) + else if (value.EqualsLiteral("postfix")) form = NS_MATHML_OPERATOR_FORM_POSTFIX; } else { diff --git a/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp index c3a62bf0d4f..732b6c17104 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmoverFrame.cpp @@ -219,9 +219,9 @@ XXX The winner is the outermost in conflicting settings like these: // if we have an accent attribute, it overrides what the overscript said if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accent_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) mEmbellishData.flags |= NS_MATHML_EMBELLISH_ACCENTOVER; - else if (value.Equals(NS_LITERAL_STRING("false"))) + else if (value.EqualsLiteral("false")) mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENTOVER; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp index bbb3ede130c..88a9d3b6658 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp @@ -264,10 +264,10 @@ nsMathMLmpaddedFrame::ParseAttribute(nsString& aString, } */ } - else if (unit.Equals(NS_LITERAL_STRING("width"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_WIDTH; - else if (unit.Equals(NS_LITERAL_STRING("height"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_HEIGHT; - else if (unit.Equals(NS_LITERAL_STRING("depth"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_DEPTH; - else if (unit.Equals(NS_LITERAL_STRING("lspace"))) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_LSPACE; + else if (unit.EqualsLiteral("width")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_WIDTH; + else if (unit.EqualsLiteral("height")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_HEIGHT; + else if (unit.EqualsLiteral("depth")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_DEPTH; + else if (unit.EqualsLiteral("lspace")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_LSPACE; else if (!gotPercent) { // percentage can only apply to a pseudo-unit // see if the unit is a named-space diff --git a/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp index 776a0cf9da5..179f70ea447 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmstyleFrame.cpp @@ -92,11 +92,11 @@ nsMathMLmstyleFrame::InheritAutomaticData(nsIPresContext* aPresContext, nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::displaystyle_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) { + if (value.EqualsLiteral("true")) { mPresentationData.flags |= NS_MATHML_MSTYLE_WITH_DISPLAYSTYLE; mPresentationData.flags |= NS_MATHML_DISPLAYSTYLE; } - else if (value.Equals(NS_LITERAL_STRING("false"))) { + else if (value.EqualsLiteral("false")) { mPresentationData.flags |= NS_MATHML_MSTYLE_WITH_DISPLAYSTYLE; mPresentationData.flags &= ~NS_MATHML_DISPLAYSTYLE; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmtableFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmtableFrame.cpp index fae251b24d2..99b87da07ec 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmtableFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmtableFrame.cpp @@ -397,10 +397,10 @@ nsMathMLmtableOuterFrame::InheritAutomaticData(nsIPresContext* aPresContext, nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, nsnull, nsMathMLAtoms::displaystyle_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) { + if (value.EqualsLiteral("true")) { mPresentationData.flags |= NS_MATHML_DISPLAYSTYLE; } - else if (value.Equals(NS_LITERAL_STRING("false"))) { + else if (value.EqualsLiteral("false")) { mPresentationData.flags &= ~NS_MATHML_DISPLAYSTYLE; } } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp index 4d51167de00..16e39c5e8e9 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmunderFrame.cpp @@ -219,9 +219,9 @@ XXX The winner is the outermost setting in conflicting settings like these: // if we have an accentunder attribute, it overrides what the underscript said if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accentunder_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) mEmbellishData.flags |= NS_MATHML_EMBELLISH_ACCENTUNDER; - else if (value.Equals(NS_LITERAL_STRING("false"))) + else if (value.EqualsLiteral("false")) mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENTUNDER; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp index 10a8e45cec3..b7ae59dfb47 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp @@ -223,9 +223,9 @@ nsMathMLmunderoverFrame::TransmitAutomaticData(nsIPresContext* aPresContext) // if we have an accentunder attribute, it overrides what the underscript said if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accentunder_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) mEmbellishData.flags |= NS_MATHML_EMBELLISH_ACCENTUNDER; - else if (value.Equals(NS_LITERAL_STRING("false"))) + else if (value.EqualsLiteral("false")) mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENTUNDER; } @@ -240,9 +240,9 @@ nsMathMLmunderoverFrame::TransmitAutomaticData(nsIPresContext* aPresContext) // if we have an accent attribute, it overrides what the overscript said if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsMathMLAtoms::accent_, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) mEmbellishData.flags |= NS_MATHML_EMBELLISH_ACCENTOVER; - else if (value.Equals(NS_LITERAL_STRING("false"))) + else if (value.EqualsLiteral("false")) mEmbellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENTOVER; } diff --git a/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp b/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp index f94ca85f9d3..f72213c517d 100644 --- a/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp +++ b/mozilla/layout/mathml/content/src/nsMathMLOperators.cpp @@ -117,29 +117,29 @@ SetProperty(OperatorData* aOperatorData, // maxsize (default: infinity) // minsize (default: 1) - if (aValue.Equals(NS_LITERAL_STRING("true"))) { + if (aValue.EqualsLiteral("true")) { // see if we should enable flags with default value=false - if (aName.Equals(NS_LITERAL_STRING("fence"))) + if (aName.EqualsLiteral("fence")) aOperatorData->mFlags |= NS_MATHML_OPERATOR_FENCE; - else if (aName.Equals(NS_LITERAL_STRING("accent"))) + else if (aName.EqualsLiteral("accent")) aOperatorData->mFlags |= NS_MATHML_OPERATOR_ACCENT; - else if (aName.Equals(NS_LITERAL_STRING("largeop"))) + else if (aName.EqualsLiteral("largeop")) aOperatorData->mFlags |= NS_MATHML_OPERATOR_LARGEOP; - else if (aName.Equals(NS_LITERAL_STRING("separator"))) + else if (aName.EqualsLiteral("separator")) aOperatorData->mFlags |= NS_MATHML_OPERATOR_SEPARATOR; - else if (aName.Equals(NS_LITERAL_STRING("movablelimits"))) + else if (aName.EqualsLiteral("movablelimits")) aOperatorData->mFlags |= NS_MATHML_OPERATOR_MOVABLELIMITS; } - else if (aValue.Equals(NS_LITERAL_STRING("false"))) { + else if (aValue.EqualsLiteral("false")) { // see if we should disable flags with default value=true - if (aName.Equals(NS_LITERAL_STRING("symmetric"))) + if (aName.EqualsLiteral("symmetric")) aOperatorData->mFlags &= ~NS_MATHML_OPERATOR_SYMMETRIC; } - else if (aName.Equals(NS_LITERAL_STRING("stretchy")) && + else if (aName.EqualsLiteral("stretchy") && (1 == aOperatorData->mStr.Length())) { - if (aValue.Equals(NS_LITERAL_STRING("vertical"))) + if (aValue.EqualsLiteral("vertical")) aOperatorData->mFlags |= NS_MATHML_OPERATOR_STRETCHY_VERT; - else if (aValue.Equals(NS_LITERAL_STRING("horizontal"))) + else if (aValue.EqualsLiteral("horizontal")) aOperatorData->mFlags |= NS_MATHML_OPERATOR_STRETCHY_HORIZ; else return; // invalid value if (kNotFound == nsMathMLOperators::FindStretchyOperator(aOperatorData->mStr[0])) { @@ -150,9 +150,9 @@ SetProperty(OperatorData* aOperatorData, PRInt32 i = 0; float space = 0.0f; PRBool isLeftSpace; - if (aName.Equals(NS_LITERAL_STRING("lspace"))) + if (aName.EqualsLiteral("lspace")) isLeftSpace = PR_TRUE; - else if (aName.Equals(NS_LITERAL_STRING("rspace"))) + else if (aName.EqualsLiteral("rspace")) isLeftSpace = PR_FALSE; else return; // input is not applicable @@ -163,13 +163,13 @@ SetProperty(OperatorData* aOperatorData, if (error) return; } // See if it is one of the 'namedspace' (ranging 1/18em...7/18em) - else if (aValue.Equals(NS_LITERAL_STRING("veryverythinmathspace"))) i = 1; - else if (aValue.Equals(NS_LITERAL_STRING("verythinmathspace"))) i = 2; - else if (aValue.Equals(NS_LITERAL_STRING("thinmathspace"))) i = 3; - else if (aValue.Equals(NS_LITERAL_STRING("mediummathspace"))) i = 4; - else if (aValue.Equals(NS_LITERAL_STRING("thickmathspace"))) i = 5; - else if (aValue.Equals(NS_LITERAL_STRING("verythickmathspace"))) i = 6; - else if (aValue.Equals(NS_LITERAL_STRING("veryverythickmathspace"))) i = 7; + else if (aValue.EqualsLiteral("veryverythinmathspace")) i = 1; + else if (aValue.EqualsLiteral("verythinmathspace")) i = 2; + else if (aValue.EqualsLiteral("thinmathspace")) i = 3; + else if (aValue.EqualsLiteral("mediummathspace")) i = 4; + else if (aValue.EqualsLiteral("thickmathspace")) i = 5; + else if (aValue.EqualsLiteral("verythickmathspace")) i = 6; + else if (aValue.EqualsLiteral("veryverythickmathspace")) i = 7; if (0 != i) // it was a namedspace value space = float(i)/float(18); diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index ed6b428794d..f431906acbc 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -295,9 +295,9 @@ void nsBoxFrame::UpdateMouseThrough() if (mContent) { nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::mousethrough, value)) { - if (value.Equals(NS_LITERAL_STRING("never"))) + if (value.EqualsLiteral("never")) mMouseThrough = never; - else if (value.Equals(NS_LITERAL_STRING("always"))) + else if (value.EqualsLiteral("always")) mMouseThrough = always; } @@ -374,10 +374,10 @@ nsBoxFrame::GetInitialDebug(PRBool& aDebug) if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::debug, value)) { - if (value.Equals(NS_LITERAL_STRING("true"))) { + if (value.EqualsLiteral("true")) { aDebug = PR_TRUE; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("false"))) { + } else if (value.EqualsLiteral("false")) { aDebug = PR_FALSE; return PR_TRUE; } @@ -398,10 +398,10 @@ nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign) if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value)) { // XXXdwh Everything inside this if statement is deprecated code. - if (value.Equals(NS_LITERAL_STRING("left"))) { + if (value.EqualsLiteral("left")) { aHalign = nsBoxFrame::hAlign_Left; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("right"))) { + } else if (value.EqualsLiteral("right")) { aHalign = nsBoxFrame::hAlign_Right; return PR_TRUE; } @@ -415,13 +415,13 @@ nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign) res = content->GetAttr(kNameSpaceID_None, nsXULAtoms::pack, value); else res = content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value); if (res == NS_CONTENT_ATTR_HAS_VALUE) { - if (value.Equals(NS_LITERAL_STRING("start"))) { + if (value.EqualsLiteral("start")) { aHalign = nsBoxFrame::hAlign_Left; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("center"))) { + } else if (value.EqualsLiteral("center")) { aHalign = nsBoxFrame::hAlign_Center; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("end"))) { + } else if (value.EqualsLiteral("end")) { aHalign = nsBoxFrame::hAlign_Right; return PR_TRUE; } @@ -480,16 +480,16 @@ nsBoxFrame::GetInitialVAlignment(nsBoxFrame::Valignment& aValign) return PR_FALSE; if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::valign, value)) { - if (value.Equals(NS_LITERAL_STRING("top"))) { + if (value.EqualsLiteral("top")) { aValign = nsBoxFrame::vAlign_Top; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("baseline"))) { + } else if (value.EqualsLiteral("baseline")) { aValign = nsBoxFrame::vAlign_BaseLine; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("middle"))) { + } else if (value.EqualsLiteral("middle")) { aValign = nsBoxFrame::vAlign_Middle; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("bottom"))) { + } else if (value.EqualsLiteral("bottom")) { aValign = nsBoxFrame::vAlign_Bottom; return PR_TRUE; } @@ -503,16 +503,16 @@ nsBoxFrame::GetInitialVAlignment(nsBoxFrame::Valignment& aValign) res = content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value); else res = content->GetAttr(kNameSpaceID_None, nsXULAtoms::pack, value); if (res == NS_CONTENT_ATTR_HAS_VALUE) { - if (value.Equals(NS_LITERAL_STRING("start"))) { + if (value.EqualsLiteral("start")) { aValign = nsBoxFrame::vAlign_Top; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("center"))) { + } else if (value.EqualsLiteral("center")) { aValign = nsBoxFrame::vAlign_Middle; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("baseline"))) { + } else if (value.EqualsLiteral("baseline")) { aValign = nsBoxFrame::vAlign_BaseLine; return PR_TRUE; - } else if (value.Equals(NS_LITERAL_STRING("end"))) { + } else if (value.EqualsLiteral("end")) { aValign = nsBoxFrame::vAlign_Bottom; return PR_TRUE; } @@ -585,9 +585,9 @@ nsBoxFrame::GetInitialOrientation(PRBool& aIsHorizontal) // Now see if we have an attribute. The attribute overrides // the style system value. if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::orient, value)) { - if (value.Equals(NS_LITERAL_STRING("vertical"))) + if (value.EqualsLiteral("vertical")) aIsHorizontal = PR_FALSE; - else if (value.Equals(NS_LITERAL_STRING("horizontal"))) + else if (value.EqualsLiteral("horizontal")) aIsHorizontal = PR_TRUE; } } @@ -618,11 +618,11 @@ nsBoxFrame::GetInitialDirection(PRBool& aIsNormal) // Now see if we have an attribute. The attribute overrides // the style system value. if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::dir, value)) { - if (value.Equals(NS_LITERAL_STRING("reverse"))) + if (value.EqualsLiteral("reverse")) aIsNormal = !aIsNormal; // Invert our direction. - else if (value.Equals(NS_LITERAL_STRING("ltr"))) + else if (value.EqualsLiteral("ltr")) aIsNormal = PR_TRUE; - else if (value.Equals(NS_LITERAL_STRING("rtl"))) + else if (value.EqualsLiteral("rtl")) aIsNormal = PR_FALSE; } } @@ -643,7 +643,7 @@ nsBoxFrame::GetInitialEqualSize(PRBool& aEqualSize) if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::equalsize, value)) { - if (value.Equals(NS_LITERAL_STRING("always"))) { + if (value.EqualsLiteral("always")) { aEqualSize = PR_TRUE; return PR_TRUE; } @@ -667,7 +667,7 @@ nsBoxFrame::GetInitialAutoStretch(PRBool& aStretch) // Check the align attribute. if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value)) { - aStretch = value.Equals(NS_LITERAL_STRING("stretch")); + aStretch = value.EqualsLiteral("stretch"); return PR_TRUE; } diff --git a/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp b/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp index c5905a356d4..b5cdd1da420 100644 --- a/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsButtonBoxFrame.cpp @@ -156,7 +156,7 @@ nsButtonBoxFrame::MouseClicked (nsIPresContext* aPresContext, nsGUIEvent* aEvent // Don't execute if we're disabled. nsAutoString disabled; mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled.Equals(NS_LITERAL_STRING("true"))) + if (disabled.EqualsLiteral("true")) return; // Execute the oncommand event handler. diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp index 38b9278e66e..058d146727f 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp @@ -381,9 +381,9 @@ nsImageBoxFrame::UpdateLoadFlags() { nsAutoString loadPolicy; mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::validate, loadPolicy); - if (loadPolicy.Equals(NS_LITERAL_STRING("always"))) + if (loadPolicy.EqualsLiteral("always")) mLoadFlags = nsIRequest::VALIDATE_ALWAYS; - else if (loadPolicy.Equals(NS_LITERAL_STRING("never"))) + else if (loadPolicy.EqualsLiteral("never")) mLoadFlags = nsIRequest::VALIDATE_NEVER|nsIRequest::LOAD_FROM_CACHE; else mLoadFlags = nsIRequest::LOAD_NORMAL; diff --git a/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp b/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp index 091e0d1ea4c..cd5805fa509 100644 --- a/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp @@ -151,9 +151,9 @@ void nsLeafBoxFrame::UpdateMouseThrough() if (mContent) { nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::mousethrough, value)) { - if (value.Equals(NS_LITERAL_STRING("never"))) + if (value.EqualsLiteral("never")) mMouseThrough = never; - else if (value.Equals(NS_LITERAL_STRING("always"))) + else if (value.EqualsLiteral("always")) mMouseThrough = always; } diff --git a/mozilla/layout/xul/base/src/nsListItemFrame.cpp b/mozilla/layout/xul/base/src/nsListItemFrame.cpp index f456ba3c032..a0c62c2d65e 100644 --- a/mozilla/layout/xul/base/src/nsListItemFrame.cpp +++ b/mozilla/layout/xul/base/src/nsListItemFrame.cpp @@ -87,7 +87,7 @@ nsListItemFrame::GetFrameForPoint(nsIPresContext* aPresContext, { nsAutoString value; mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value.Equals(NS_LITERAL_STRING("true"))) { + if (value.EqualsLiteral("true")) { return nsBoxFrame::GetFrameForPoint(aPresContext, aPoint, aWhichLayer, aFrame); } else if (mRect.Contains(aPoint)) { diff --git a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp index c11af6976c8..9bfcb3f766c 100644 --- a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp @@ -775,7 +775,7 @@ nsMenuBarFrame::IsDisabled(nsIContent* aContent) { nsString disabled; aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled.Equals(NS_LITERAL_STRING("true"))) + if (disabled.EqualsLiteral("true")) return PR_TRUE; return PR_FALSE; } diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 99405258349..1f225ad5994 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -355,7 +355,7 @@ nsMenuFrame::GetFrameForPoint(nsIPresContext* aPresContext, // This allows selective overriding for subcontent. nsAutoString value; content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) return result; } if (GetStyleVisibility()->IsVisible()) { @@ -685,7 +685,7 @@ nsMenuFrame::AttributeChanged(nsIPresContext* aPresContext, if (aAttribute == nsXULAtoms::open) { aChild->GetAttr(kNameSpaceID_None, aAttribute, value); - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) OpenMenuInternal(PR_TRUE); else { OpenMenuInternal(PR_FALSE); @@ -932,8 +932,8 @@ nsMenuFrame::IsSizedToPopup(nsIContent* aContent, PRBool aRequireAlways) else { nsAutoString sizedToPopup; aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::sizetopopup, sizedToPopup); - sizeToPopup = sizedToPopup.Equals(NS_LITERAL_STRING("always")) || - !aRequireAlways && sizedToPopup.Equals(NS_LITERAL_STRING("pref")); + sizeToPopup = sizedToPopup.EqualsLiteral("always") || + !aRequireAlways && sizedToPopup.EqualsLiteral("pref"); } return sizeToPopup; @@ -1108,39 +1108,39 @@ static void ConvertPosition(nsIContent* aPopupElt, nsString& aAnchor, nsString& if (position.IsEmpty()) return; - if (position.Equals(NS_LITERAL_STRING("before_start"))) { + if (position.EqualsLiteral("before_start")) { aAnchor.Assign(NS_LITERAL_STRING("topleft")); aAlign.Assign(NS_LITERAL_STRING("bottomleft")); } - else if (position.Equals(NS_LITERAL_STRING("before_end"))) { + else if (position.EqualsLiteral("before_end")) { aAnchor.Assign(NS_LITERAL_STRING("topright")); aAlign.Assign(NS_LITERAL_STRING("bottomright")); } - else if (position.Equals(NS_LITERAL_STRING("after_start"))) { + else if (position.EqualsLiteral("after_start")) { aAnchor.Assign(NS_LITERAL_STRING("bottomleft")); aAlign.Assign(NS_LITERAL_STRING("topleft")); } - else if (position.Equals(NS_LITERAL_STRING("after_end"))) { + else if (position.EqualsLiteral("after_end")) { aAnchor.Assign(NS_LITERAL_STRING("bottomright")); aAlign.Assign(NS_LITERAL_STRING("topright")); } - else if (position.Equals(NS_LITERAL_STRING("start_before"))) { + else if (position.EqualsLiteral("start_before")) { aAnchor.Assign(NS_LITERAL_STRING("topleft")); aAlign.Assign(NS_LITERAL_STRING("topright")); } - else if (position.Equals(NS_LITERAL_STRING("start_after"))) { + else if (position.EqualsLiteral("start_after")) { aAnchor.Assign(NS_LITERAL_STRING("bottomleft")); aAlign.Assign(NS_LITERAL_STRING("bottomright")); } - else if (position.Equals(NS_LITERAL_STRING("end_before"))) { + else if (position.EqualsLiteral("end_before")) { aAnchor.Assign(NS_LITERAL_STRING("topright")); aAlign.Assign(NS_LITERAL_STRING("topleft")); } - else if (position.Equals(NS_LITERAL_STRING("end_after"))) { + else if (position.EqualsLiteral("end_after")) { aAnchor.Assign(NS_LITERAL_STRING("bottomright")); aAlign.Assign(NS_LITERAL_STRING("bottomleft")); } - else if (position.Equals(NS_LITERAL_STRING("overlap"))) { + else if (position.EqualsLiteral("overlap")) { aAnchor.Assign(NS_LITERAL_STRING("topleft")); aAlign.Assign(NS_LITERAL_STRING("topleft")); } @@ -1294,7 +1294,7 @@ nsMenuFrame::Notify(nsITimer* aTimer) if (!mMenuOpen && mMenuParent) { nsAutoString active; mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, active); - if (active.Equals(NS_LITERAL_STRING("true"))) { + if (active.EqualsLiteral("true")) { // We're still the active menu. Make sure all submenus/timers are closed // before opening this one mMenuParent->KillPendingTimers(); @@ -1314,7 +1314,7 @@ nsMenuFrame::IsDisabled() { nsAutoString disabled; mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled.Equals(NS_LITERAL_STRING("true"))) + if (disabled.EqualsLiteral("true")) return PR_TRUE; return PR_FALSE; } @@ -1324,9 +1324,9 @@ nsMenuFrame::UpdateMenuType(nsIPresContext* aPresContext) { nsAutoString value; mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value); - if (value.Equals(NS_LITERAL_STRING("checkbox"))) + if (value.EqualsLiteral("checkbox")) mType = eMenuType_Checkbox; - else if (value.Equals(NS_LITERAL_STRING("radio"))) { + else if (value.EqualsLiteral("radio")) { mType = eMenuType_Radio; nsAutoString valueName; @@ -1351,7 +1351,7 @@ nsMenuFrame::UpdateMenuSpecialState(nsIPresContext* aPresContext) { mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, value); - newChecked = (value.Equals(NS_LITERAL_STRING("true"))); + newChecked = (value.EqualsLiteral("true")); if (newChecked == mChecked) { /* checked state didn't change */ @@ -1580,7 +1580,7 @@ nsMenuFrame::Execute(nsGUIEvent *aEvent) if (mType == eMenuType_Checkbox || (mType == eMenuType_Radio && !mChecked)) { nsAutoString value; mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::autocheck, value); - if (!value.Equals(NS_LITERAL_STRING("false"))) { + if (!value.EqualsLiteral("false")) { if (mChecked) { mContent->UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, PR_TRUE); diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 4ca5e800921..2e305f08ff3 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -654,74 +654,74 @@ nsMenuPopupFrame::AdjustPositionForAnchorAlign ( PRInt32* ioXPos, PRInt32* ioYPo nsAutoString popupAlign(aPopupAlign); if (GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) { - if (popupAnchor == NS_LITERAL_STRING("topright")) + if (popupAnchor.EqualsLiteral("topright")) popupAnchor.Assign(NS_LITERAL_STRING("topleft")); - else if (popupAnchor == NS_LITERAL_STRING("topleft")) + else if (popupAnchor.EqualsLiteral("topleft")) popupAnchor.Assign(NS_LITERAL_STRING("topright")); - else if (popupAnchor == NS_LITERAL_STRING("bottomleft")) + else if (popupAnchor.EqualsLiteral("bottomleft")) popupAnchor.Assign(NS_LITERAL_STRING("bottomright")); - else if (popupAnchor == NS_LITERAL_STRING("bottomright")) + else if (popupAnchor.EqualsLiteral("bottomright")) popupAnchor.Assign(NS_LITERAL_STRING("bottomleft")); - if (popupAlign == NS_LITERAL_STRING("topright")) + if (popupAlign.EqualsLiteral("topright")) popupAlign.Assign(NS_LITERAL_STRING("topleft")); - else if (popupAlign == NS_LITERAL_STRING("topleft")) + else if (popupAlign.EqualsLiteral("topleft")) popupAlign.Assign(NS_LITERAL_STRING("topright")); - else if (popupAlign == NS_LITERAL_STRING("bottomleft")) + else if (popupAlign.EqualsLiteral("bottomleft")) popupAlign.Assign(NS_LITERAL_STRING("bottomright")); - else if (popupAnchor == NS_LITERAL_STRING("bottomright")) + else if (popupAnchor.EqualsLiteral("bottomright")) popupAlign.Assign(NS_LITERAL_STRING("bottomleft")); } // Adjust position for margins at the aligned corner nsMargin margin; GetStyleMargin()->GetMargin(margin); - if (popupAlign == NS_LITERAL_STRING("topleft")) { + if (popupAlign.EqualsLiteral("topleft")) { *ioXPos += margin.left; *ioYPos += margin.top; - } else if (popupAlign == NS_LITERAL_STRING("topright")) { + } else if (popupAlign.EqualsLiteral("topright")) { *ioXPos += margin.right; *ioYPos += margin.top; - } else if (popupAlign == NS_LITERAL_STRING("bottomleft")) { + } else if (popupAlign.EqualsLiteral("bottomleft")) { *ioXPos += margin.left; *ioYPos += margin.bottom; - } else if (popupAlign == NS_LITERAL_STRING("bottomright")) { + } else if (popupAlign.EqualsLiteral("bottomright")) { *ioXPos += margin.right; *ioYPos += margin.bottom; } - if (popupAnchor == NS_LITERAL_STRING("topright") && popupAlign == NS_LITERAL_STRING("topleft")) { + if (popupAnchor.EqualsLiteral("topright") && popupAlign.EqualsLiteral("topleft")) { *ioXPos += inParentRect.width; } - else if (popupAnchor == NS_LITERAL_STRING("topleft") && popupAlign == NS_LITERAL_STRING("topleft")) { + else if (popupAnchor.EqualsLiteral("topleft") && popupAlign.EqualsLiteral("topleft")) { *outFlushWithTopBottom = PR_TRUE; } - else if (popupAnchor == NS_LITERAL_STRING("topright") && popupAlign == NS_LITERAL_STRING("bottomright")) { + else if (popupAnchor.EqualsLiteral("topright") && popupAlign.EqualsLiteral("bottomright")) { *ioXPos -= (mRect.width - inParentRect.width); *ioYPos -= mRect.height; *outFlushWithTopBottom = PR_TRUE; } - else if (popupAnchor == NS_LITERAL_STRING("bottomright") && popupAlign == NS_LITERAL_STRING("bottomleft")) { + else if (popupAnchor.EqualsLiteral("bottomright") && popupAlign.EqualsLiteral("bottomleft")) { *ioXPos += inParentRect.width; *ioYPos -= (mRect.height - inParentRect.height); } - else if (popupAnchor == NS_LITERAL_STRING("bottomright") && popupAlign == NS_LITERAL_STRING("topright")) { + else if (popupAnchor.EqualsLiteral("bottomright") && popupAlign.EqualsLiteral("topright")) { *ioXPos -= (mRect.width - inParentRect.width); *ioYPos += inParentRect.height; *outFlushWithTopBottom = PR_TRUE; } - else if (popupAnchor == NS_LITERAL_STRING("topleft") && popupAlign == NS_LITERAL_STRING("topright")) { + else if (popupAnchor.EqualsLiteral("topleft") && popupAlign.EqualsLiteral("topright")) { *ioXPos -= mRect.width; } - else if (popupAnchor == NS_LITERAL_STRING("topleft") && popupAlign == NS_LITERAL_STRING("bottomleft")) { + else if (popupAnchor.EqualsLiteral("topleft") && popupAlign.EqualsLiteral("bottomleft")) { *ioYPos -= mRect.height; *outFlushWithTopBottom = PR_TRUE; } - else if (popupAnchor == NS_LITERAL_STRING("bottomleft") && popupAlign == NS_LITERAL_STRING("bottomright")) { + else if (popupAnchor.EqualsLiteral("bottomleft") && popupAlign.EqualsLiteral("bottomright")) { *ioXPos -= mRect.width; *ioYPos -= (mRect.height - inParentRect.height); } - else if (popupAnchor == NS_LITERAL_STRING("bottomleft") && popupAlign == NS_LITERAL_STRING("topleft")) { + else if (popupAnchor.EqualsLiteral("bottomleft") && popupAlign.EqualsLiteral("topleft")) { *ioYPos += inParentRect.height; *outFlushWithTopBottom = PR_TRUE; } @@ -1211,9 +1211,9 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, nsAutoString shouldDisplay, menuActive; mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, menuActive); - if (menuActive != NS_LITERAL_STRING("true")) { + if (!menuActive.EqualsLiteral("true")) { mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay); - if ( shouldDisplay == NS_LITERAL_STRING("true") ) + if ( shouldDisplay.EqualsLiteral("true") ) mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, NS_LITERAL_STRING("true"), PR_TRUE); } @@ -1378,7 +1378,7 @@ NS_IMETHODIMP nsMenuPopupFrame::ConsumeOutsideClicks(PRBool& aConsumeOutsideClic // Don't consume outside clicks for autocomplete widget nsAutoString typeString; parentContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, typeString); - if (typeString.Equals(NS_LITERAL_STRING("autocomplete"))) + if (typeString.EqualsLiteral("autocomplete")) aConsumeOutsideClicks = PR_FALSE; } } @@ -1701,7 +1701,7 @@ nsMenuPopupFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent, PRBool& doActi // Get the active status current->GetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, activeKey); - if (activeKey == NS_LITERAL_STRING("true")) { + if (activeKey.EqualsLiteral("true")) { foundActive = PR_TRUE; if (stringLength > 1) { // If there is more than one char typed, the current item has highest priority, @@ -2026,7 +2026,7 @@ nsMenuPopupFrame::IsDisabled(nsIContent* aContent) { nsString disabled; aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled == NS_LITERAL_STRING("true")) + if (disabled.EqualsLiteral("true")) return PR_TRUE; return PR_FALSE; } diff --git a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp index acbef9ad7bf..89942b02eca 100644 --- a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp @@ -393,7 +393,7 @@ nsPopupSetFrame::ShowPopup(nsIContent* aElementContent, nsIContent* aPopupConten nsIMenuParent* childPopup = nsnull; if (activeChild) CallQueryInterface(activeChild, &childPopup); - if ( childPopup && aPopupType == NS_LITERAL_STRING("context") ) + if ( childPopup && aPopupType.EqualsLiteral("context") ) childPopup->SetIsContextMenu(PR_TRUE); // Now open the popup. @@ -418,7 +418,7 @@ nsPopupSetFrame::HidePopup(nsIFrame* aPopup) if (entry->mCreateHandlerSucceeded) ActivatePopup(entry, PR_FALSE); - if (entry->mElementContent && entry->mPopupType == NS_LITERAL_STRING("context")) { + if (entry->mElementContent && entry->mPopupType.EqualsLiteral("context")) { // If we are a context menu, and if we are attached to a // menupopup, then hiding us should also hide the parent menu // popup. @@ -449,7 +449,7 @@ nsPopupSetFrame::DestroyPopup(nsIFrame* aPopup, PRBool aDestroyEntireChain) OpenPopup(entry, PR_FALSE); entry->mPopupType.SetLength(0); - if (aDestroyEntireChain && entry->mElementContent && entry->mPopupType == NS_LITERAL_STRING("context")) { + if (aDestroyEntireChain && entry->mElementContent && entry->mPopupType.EqualsLiteral("context")) { // If we are a context menu, and if we are attached to a // menupopup, then destroying us should also dismiss the parent // menu popup. @@ -487,7 +487,7 @@ nsPopupSetFrame::MarkAsGenerated(nsIContent* aPopupContent) nsAutoString value; aPopupContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, value); - if (value != NS_LITERAL_STRING("true")) { + if (!value.EqualsLiteral("true")) { // Generate this element. aPopupContent->SetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, NS_LITERAL_STRING("true"), PR_TRUE); @@ -505,16 +505,16 @@ nsPopupSetFrame::OpenPopup(nsPopupFrameList* aEntry, PRBool aActivateFlag) nsIMenuParent* childPopup = nsnull; if (activeChild) CallQueryInterface(activeChild, &childPopup); - if (aEntry->mPopupType != NS_LITERAL_STRING("tooltip")) + if (!aEntry->mPopupType.EqualsLiteral("tooltip")) UpdateDismissalListener(childPopup); // First check and make sure this popup wants keyboard navigation nsAutoString property; // Tooltips don't get keyboard navigation aEntry->mPopupContent->GetAttr(kNameSpaceID_None, nsXULAtoms::ignorekeys, property); - if (property != NS_LITERAL_STRING("true") && + if (!property.EqualsLiteral("true") && childPopup && - aEntry->mPopupType != NS_LITERAL_STRING("tooltip")) + !aEntry->mPopupType.EqualsLiteral("tooltip")) childPopup->InstallKeyboardNavigator(); } else { @@ -522,7 +522,7 @@ nsPopupSetFrame::OpenPopup(nsPopupFrameList* aEntry, PRBool aActivateFlag) return; // Unregister, but not if we're a tooltip - if (aEntry->mPopupType != NS_LITERAL_STRING("tooltip") ) { + if (!aEntry->mPopupType.EqualsLiteral("tooltip") ) { if (nsMenuFrame::sDismissalListener) nsMenuFrame::sDismissalListener->Unregister(); } diff --git a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp index 9614ec386a0..11cc047aba3 100644 --- a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp +++ b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp @@ -179,9 +179,9 @@ nsScrollbarButtonFrame::MouseClicked() { // if our class is DecrementButton subtract the current pos by increment amount // if our class is IncrementButton increment the current pos by the decrement amount - if (value.Equals(NS_LITERAL_STRING("decrement"))) + if (value.EqualsLiteral("decrement")) curpos -= increment; - else if (value.Equals(NS_LITERAL_STRING("increment"))) + else if (value.EqualsLiteral("increment")) curpos += increment; // make sure the current positon is between the current and max positions diff --git a/mozilla/layout/xul/base/src/nsSplitterFrame.cpp b/mozilla/layout/xul/base/src/nsSplitterFrame.cpp index 5ba33d4f924..a309f5de881 100644 --- a/mozilla/layout/xul/base/src/nsSplitterFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSplitterFrame.cpp @@ -186,7 +186,7 @@ nsSplitterFrameInner::GetResizeBefore() nsString value; mOuter->GetContent()->GetAttr(kNameSpaceID_None, nsXULAtoms::resizebefore, value); - if (value.Equals(NS_LITERAL_STRING("farthest"))) + if (value.EqualsLiteral("farthest")) return Farthest; return Closest; } @@ -203,9 +203,9 @@ nsSplitterFrameInner::GetResizeAfter() nsString value; mOuter->GetContent()->GetAttr(kNameSpaceID_None, nsXULAtoms::resizeafter, value); - if (value.Equals(NS_LITERAL_STRING("farthest"))) + if (value.EqualsLiteral("farthest")) return Farthest; - if (value.Equals(NS_LITERAL_STRING("grow"))) + if (value.EqualsLiteral("grow")) return Grow; return Closest; } @@ -216,9 +216,9 @@ nsSplitterFrameInner::GetState() nsString value; mOuter->GetContent()->GetAttr(kNameSpaceID_None, nsXULAtoms::state, value); - if (value.Equals(NS_LITERAL_STRING("dragging"))) + if (value.EqualsLiteral("dragging")) return Dragging; - if (value.Equals(NS_LITERAL_STRING("collapsed"))) + if (value.EqualsLiteral("collapsed")) return Collapsed; return Open; } @@ -743,7 +743,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent) nsAutoString disabled; mOuter->GetContent()->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); - if (disabled.Equals(NS_LITERAL_STRING("true"))) + if (disabled.EqualsLiteral("true")) return NS_OK; nsBoxLayoutState state(mOuter->mPresContext); @@ -951,9 +951,9 @@ nsSplitterFrameInner::GetCollapseDirection() nsString value; if (NS_CONTENT_ATTR_HAS_VALUE == mOuter->mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::collapse, value)) { - if (value.Equals(NS_LITERAL_STRING("before"))) + if (value.EqualsLiteral("before")) return Before; - else if (value.Equals(NS_LITERAL_STRING("after"))) + else if (value.EqualsLiteral("after")) return After; else return None; diff --git a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp index 3db36c21ec7..f497f434b65 100644 --- a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp @@ -219,13 +219,13 @@ nsTextBoxFrame::UpdateAttributes(nsIPresContext* aPresContext, mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::crop, value); CroppingStyle cropType; - if (value.Equals(NS_LITERAL_STRING(CROP_LEFT)) || - value.Equals(NS_LITERAL_STRING(CROP_START))) + if (value.EqualsASCII(CROP_LEFT) || + value.EqualsASCII(CROP_START)) cropType = CropLeft; - else if (value.Equals(NS_LITERAL_STRING(CROP_CENTER))) + else if (value.EqualsASCII(CROP_CENTER)) cropType = CropCenter; - else if (value.Equals(NS_LITERAL_STRING(CROP_RIGHT)) || - value.Equals(NS_LITERAL_STRING(CROP_END))) + else if (value.EqualsASCII(CROP_RIGHT) || + value.EqualsASCII(CROP_END)) cropType = CropRight; else cropType = CropNone; diff --git a/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp b/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp index 76fe664d09b..33d3ab12b24 100644 --- a/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp +++ b/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp @@ -232,7 +232,7 @@ nsXULTooltipListener::HandleEvent(nsIDOMEvent* aEvent) { nsAutoString type; aEvent->GetType(type); - if (type.Equals(NS_LITERAL_STRING("DOMMouseScroll"))) + if (type.EqualsLiteral("DOMMouseScroll")) HideTooltip(); return NS_OK; } @@ -333,7 +333,7 @@ nsXULTooltipListener::CheckTreeBodyMove(nsIDOMMouseEvent* aMouseEvent) // determine if we are going to need a titletip // XXX check the disabletitletips attribute on the tree content mNeedTitletip = PR_FALSE; - if (row >= 0 && obj.Equals(NS_LITERAL_CSTRING("text"))) { + if (row >= 0 && obj.EqualsLiteral("text")) { nsCOMPtr view; obx->GetView(getter_AddRefs(view)); PRBool isCropped; @@ -385,7 +385,7 @@ nsXULTooltipListener::ShowTooltip() return NS_ERROR_FAILURE; nsAutoString noAutoHide; tooltipEl->GetAttribute(NS_LITERAL_STRING("noautohide"), noAutoHide); - if (noAutoHide != NS_LITERAL_STRING("true")) + if (!noAutoHide.EqualsLiteral("true")) CreateAutoHideTimer(); // listen for popuphidden on the tooltip node, so that we can @@ -562,7 +562,7 @@ nsXULTooltipListener::GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip) targetEl->GetAttribute(NS_LITERAL_STRING("tooltip"), tooltipId); // if tooltip == _child, look for first child - if (tooltipId.Equals(NS_LITERAL_STRING("_child"))) { + if (tooltipId.EqualsLiteral("_child")) { GetImmediateChild(aTarget, nsXULAtoms::tooltip, aTooltip); return NS_OK; } else { diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 4b00c5adafa..c03bd055d1d 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -1582,7 +1582,7 @@ nsTreeBodyFrame::PrefillPropertyArray(PRInt32 aRowIndex, nsTreeColumn* aCol) if (aRowIndex != -1) { nsAutoString value; mView->GetCellValue(aRowIndex, aCol, value); - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) mScratchArray->AppendElement(nsXULAtoms::checked); } } @@ -1602,11 +1602,11 @@ nsTreeBodyFrame::PrefillPropertyArray(PRInt32 aRowIndex, nsTreeColumn* aCol) // Read special properties from attributes on the column content node nsAutoString attr; aCol->GetContent()->GetAttr(kNameSpaceID_None, nsXULAtoms::insertbefore, attr); - if (attr.Equals(NS_LITERAL_STRING("true"))) + if (attr.EqualsLiteral("true")) mScratchArray->AppendElement(nsXULAtoms::insertbefore); attr.Truncate(); aCol->GetContent()->GetAttr(kNameSpaceID_None, nsXULAtoms::insertafter, attr); - if (attr.Equals(NS_LITERAL_STRING("true"))) + if (attr.EqualsLiteral("true")) mScratchArray->AppendElement(nsXULAtoms::insertafter); } } diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp index ae82b506b8c..2bdb89aa8d9 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp @@ -163,7 +163,7 @@ nsTreeColFrame::GetFrameForPoint(nsIPresContext* aPresContext, // This allows selective overriding for subcontent. nsAutoString value; content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); - if (value.Equals(NS_LITERAL_STRING("true"))) + if (value.EqualsLiteral("true")) return result; } } diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp index a2f694a78c4..b98e6d64cc0 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp @@ -215,7 +215,7 @@ nsTreeColumn::CacheAttributes() mIsPrimary = PR_FALSE; nsAutoString primary; content->GetAttr(kNameSpaceID_None, nsXULAtoms::primary, primary); - if (primary.Equals(NS_LITERAL_STRING("true"))) + if (primary.EqualsLiteral("true")) mIsPrimary = PR_TRUE; // Figure out if we're a cycling column (one that doesn't cause a selection @@ -223,32 +223,32 @@ nsTreeColumn::CacheAttributes() mIsCycler = PR_FALSE; nsAutoString cycler; content->GetAttr(kNameSpaceID_None, nsXULAtoms::cycler, cycler); - if (cycler.Equals(NS_LITERAL_STRING("true"))) + if (cycler.EqualsLiteral("true")) mIsCycler = PR_TRUE; mIsEditable = PR_FALSE; nsAutoString editable; content->GetAttr(kNameSpaceID_None, nsXULAtoms::editable, editable); - if (editable.Equals(NS_LITERAL_STRING("true"))) + if (editable.EqualsLiteral("true")) mIsEditable = PR_TRUE; // Figure out our column type. Default type is text. mType = nsITreeColumn::TYPE_TEXT; nsAutoString type; content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, type); - if (type.Equals(NS_LITERAL_STRING("checkbox"))) + if (type.EqualsLiteral("checkbox")) mType = nsITreeColumn::TYPE_CHECKBOX; - else if (type.Equals(NS_LITERAL_STRING("progressmeter"))) + else if (type.EqualsLiteral("progressmeter")) mType = nsITreeColumn::TYPE_PROGRESSMETER; // Fetch the crop style. mCropStyle = 0; nsAutoString crop; content->GetAttr(kNameSpaceID_None, nsXULAtoms::crop, crop); - if (crop.Equals(NS_LITERAL_STRING("center"))) + if (crop.EqualsLiteral("center")) mCropStyle = 1; - else if (crop.Equals(NS_LITERAL_STRING("left")) || - crop.Equals(NS_LITERAL_STRING("start"))) + else if (crop.EqualsLiteral("left") || + crop.EqualsLiteral("start")) mCropStyle = 2; } @@ -360,7 +360,7 @@ nsTreeColumns::GetKeyColumn(nsITreeColumn** _retval) // Skip hidden columns. nsAutoString attr; content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, attr); - if (attr.Equals(NS_LITERAL_STRING("true"))) + if (attr.EqualsLiteral("true")) continue; // Skip non-text column diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp index ae892d5adc5..07f614d978c 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp @@ -448,9 +448,9 @@ nsTreeContentView::GetProgressMode(PRInt32 aRow, nsITreeColumn* aCol, PRInt32* _ if (cell) { nsAutoString state; cell->GetAttr(kNameSpaceID_None, nsXULAtoms::mode, state); - if (state.Equals(NS_LITERAL_STRING("normal"))) + if (state.EqualsLiteral("normal")) *_retval = nsITreeView::PROGRESS_NORMAL; - else if (state.Equals(NS_LITERAL_STRING("undetermined"))) + else if (state.EqualsLiteral("undetermined")) *_retval = nsITreeView::PROGRESS_UNDETERMINED; } } @@ -621,7 +621,7 @@ nsTreeContentView::IsEditable(PRInt32 aRow, nsITreeColumn* aCol, PRBool* _retval if (cell) { nsAutoString editable; cell->GetAttr(kNameSpaceID_None, nsXULAtoms::editable, editable); - if (editable.Equals(NS_LITERAL_STRING("false"))) + if (editable.EqualsLiteral("false")) *_retval = PR_FALSE; } } @@ -771,7 +771,7 @@ nsTreeContentView::AttributeChanged(nsIDocument *aDocument, (tag == nsXULAtoms::treeitem || tag == nsXULAtoms::treeseparator)) { nsAutoString hiddenString; aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, hiddenString); - PRBool hidden = hiddenString.Equals(NS_LITERAL_STRING("true")); + PRBool hidden = hiddenString.EqualsLiteral("true"); PRInt32 index = FindContent(aContent); if (hidden && index >= 0) { @@ -812,7 +812,7 @@ nsTreeContentView::AttributeChanged(nsIDocument *aDocument, if (aAttribute == nsXULAtoms::container) { nsAutoString container; aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::container, container); - PRBool isContainer = container.Equals(NS_LITERAL_STRING("true")); + PRBool isContainer = container.EqualsLiteral("true"); row->SetContainer(isContainer); if (mBoxObject) mBoxObject->InvalidateRow(index); @@ -820,7 +820,7 @@ nsTreeContentView::AttributeChanged(nsIDocument *aDocument, else if (aAttribute == nsXULAtoms::open) { nsAutoString open; aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open); - PRBool isOpen = open.Equals(NS_LITERAL_STRING("true")); + PRBool isOpen = open.EqualsLiteral("true"); PRBool wasOpen = row->IsOpen(); if (! isOpen && wasOpen) CloseContainer(index); @@ -830,7 +830,7 @@ nsTreeContentView::AttributeChanged(nsIDocument *aDocument, else if (aAttribute == nsXULAtoms::empty) { nsAutoString empty; aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::empty, empty); - PRBool isEmpty = empty.Equals(NS_LITERAL_STRING("true")); + PRBool isEmpty = empty.EqualsLiteral("true"); row->SetEmpty(isEmpty); if (mBoxObject) mBoxObject->InvalidateRow(index); @@ -1103,7 +1103,7 @@ nsTreeContentView::SerializeItem(nsIContent* aContent, PRInt32 aParentIndex, PRI { nsAutoString hidden; aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); - if (hidden.Equals(NS_LITERAL_STRING("true"))) + if (hidden.EqualsLiteral("true")) return; Row* row = Row::Create(mAllocator, aContent, aParentIndex); @@ -1111,11 +1111,11 @@ nsTreeContentView::SerializeItem(nsIContent* aContent, PRInt32 aParentIndex, PRI nsAutoString container; aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::container, container); - if (container.Equals(NS_LITERAL_STRING("true"))) { + if (container.EqualsLiteral("true")) { row->SetContainer(PR_TRUE); nsAutoString open; aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open); - if (open.Equals(NS_LITERAL_STRING("true"))) { + if (open.EqualsLiteral("true")) { row->SetOpen(PR_TRUE); nsCOMPtr child; nsTreeUtils::GetImmediateChild(aContent, nsXULAtoms::treechildren, getter_AddRefs(child)); @@ -1131,7 +1131,7 @@ nsTreeContentView::SerializeItem(nsIContent* aContent, PRInt32 aParentIndex, PRI } else { nsAutoString empty; aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::empty, empty); - if (empty.Equals(NS_LITERAL_STRING("true"))) + if (empty.EqualsLiteral("true")) row->SetEmpty(PR_TRUE); } } @@ -1142,7 +1142,7 @@ nsTreeContentView::SerializeSeparator(nsIContent* aContent, PRInt32 aParentIndex { nsAutoString hidden; aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); - if (hidden.Equals(NS_LITERAL_STRING("true"))) + if (hidden.EqualsLiteral("true")) return; Row* row = Row::Create(mAllocator, aContent, aParentIndex); @@ -1206,14 +1206,14 @@ nsTreeContentView::GetIndexInSubtree(nsIContent* aContainer, if (tag == nsXULAtoms::treeitem) { nsAutoString hidden; content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); - if (! hidden.Equals(NS_LITERAL_STRING("true"))) { + if (! hidden.EqualsLiteral("true")) { (*aIndex)++; nsAutoString container; content->GetAttr(kNameSpaceID_None, nsXULAtoms::container, container); - if (container.Equals(NS_LITERAL_STRING("true"))) { + if (container.EqualsLiteral("true")) { nsAutoString open; content->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open); - if (open.Equals(NS_LITERAL_STRING("true"))) { + if (open.EqualsLiteral("true")) { nsCOMPtr child; nsTreeUtils::GetImmediateChild(content, nsXULAtoms::treechildren, getter_AddRefs(child)); if (child) @@ -1225,7 +1225,7 @@ nsTreeContentView::GetIndexInSubtree(nsIContent* aContainer, else if (tag == nsXULAtoms::treeseparator) { nsAutoString hidden; content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); - if (! hidden.Equals(NS_LITERAL_STRING("true"))) + if (! hidden.EqualsLiteral("true")) (*aIndex)++; } } diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp index 80c88a04aeb..bb1c0520908 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp @@ -320,7 +320,7 @@ NS_IMETHODIMP nsTreeSelection::GetSingle(PRBool* aSingle) nsCOMPtr content = do_QueryInterface(element); nsAutoString seltype; content->GetAttr(kNameSpaceID_None, nsXULAtoms::seltype, seltype); - *aSingle = seltype.Equals(NS_LITERAL_STRING("single")); + *aSingle = seltype.EqualsLiteral("single"); return NS_OK; }