From 67438c614e71d8abf3993ba04702e0c9aac3ca39 Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Fri, 28 Apr 2000 08:55:55 +0000 Subject: [PATCH] nsString fixes for mathml. --- layout/mathml/base/src/nsMathMLChar.cpp | 4 +-- .../base/src/nsMathMLContainerFrame.cpp | 27 ++++++++++--------- .../mathml/base/src/nsMathMLmactionFrame.cpp | 26 +++++++++++------- .../mathml/base/src/nsMathMLmfencedFrame.cpp | 6 ++--- layout/mathml/base/src/nsMathMLmfracFrame.cpp | 6 ++--- layout/mathml/base/src/nsMathMLmiFrame.cpp | 4 +-- layout/mathml/base/src/nsMathMLmoFrame.cpp | 12 +++++---- layout/mathml/base/src/nsMathMLmoverFrame.cpp | 6 ++--- .../mathml/base/src/nsMathMLmpaddedFrame.cpp | 8 +++--- .../mathml/base/src/nsMathMLmstyleFrame.cpp | 4 +-- .../mathml/base/src/nsMathMLmunderFrame.cpp | 6 ++--- .../base/src/nsMathMLmunderoverFrame.cpp | 10 +++---- layout/mathml/content/src/nsMathMLAtoms.cpp | 2 +- .../mathml/content/src/nsMathMLOperators.cpp | 3 +-- 14 files changed, 66 insertions(+), 58 deletions(-) diff --git a/layout/mathml/base/src/nsMathMLChar.cpp b/layout/mathml/base/src/nsMathMLChar.cpp index 03130f398ab1..9aca8ca944a2 100644 --- a/layout/mathml/base/src/nsMathMLChar.cpp +++ b/layout/mathml/base/src/nsMathMLChar.cpp @@ -630,7 +630,7 @@ nsMathMLChar::SetEnum(nsIPresContext* aPresContext, mEnum = aEnum; // some assumptions until proven otherwise! // note that mGlyph is not initialized - mData = ""; + mData = nsAutoString(); mDirection = NS_STRETCH_DIRECTION_UNSUPPORTED; mBoundingMetrics.Clear(); mGlyphTable = nsnull; @@ -742,7 +742,7 @@ static void SetFirstFamily(nsFont& aFont, const nsString& aFamily) nsAutoString familyList(aFamily); // XXX hack to force CMSY10 to be at least the second best choice ! if (!aFamily.EqualsIgnoreCase("CMSY10")) - familyList.Append(",CMSY10"); + familyList.AppendWithConversion(",CMSY10"); // loop over font-family: (skipping aFamily if present) aFont.EnumerateFamilies(FontEnumCallback, &familyList); // overwrite the old value of font-family: diff --git a/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/layout/mathml/base/src/nsMathMLContainerFrame.cpp index 0b6231a1e742..0b2af8bad827 100644 --- a/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -293,19 +293,19 @@ printf("String:%s, Number:%s, Unit:%s\n", s1, s2, s3); if (0 == unit.Length()) { cssUnit = eCSSUnit_Number; // no explicit unit, this is a number that will act as a multiplier } - else if (unit.Equals("%")) { + else if (unit.Equals(NS_ConvertASCIItoUCS2("%"))) { floatValue = floatValue / 100.0f; aCSSValue.SetPercentValue(floatValue); return PR_TRUE; } - else if (unit.Equals("em")) cssUnit = eCSSUnit_EM; - else if (unit.Equals("ex")) cssUnit = eCSSUnit_XHeight; - else if (unit.Equals("px")) cssUnit = eCSSUnit_Pixel; - else if (unit.Equals("in")) cssUnit = eCSSUnit_Inch; - else if (unit.Equals("cm")) cssUnit = eCSSUnit_Centimeter; - else if (unit.Equals("mm")) cssUnit = eCSSUnit_Millimeter; - else if (unit.Equals("pt")) cssUnit = eCSSUnit_Point; - else if (unit.Equals("pc")) cssUnit = eCSSUnit_Pica; + else if (unit.Equals(NS_ConvertASCIItoUCS2("em"))) cssUnit = eCSSUnit_EM; + else if (unit.Equals(NS_ConvertASCIItoUCS2("ex"))) cssUnit = eCSSUnit_XHeight; + else if (unit.Equals(NS_ConvertASCIItoUCS2("px"))) cssUnit = eCSSUnit_Pixel; + else if (unit.Equals(NS_ConvertASCIItoUCS2("in"))) cssUnit = eCSSUnit_Inch; + else if (unit.Equals(NS_ConvertASCIItoUCS2("cm"))) cssUnit = eCSSUnit_Centimeter; + else if (unit.Equals(NS_ConvertASCIItoUCS2("mm"))) cssUnit = eCSSUnit_Millimeter; + else if (unit.Equals(NS_ConvertASCIItoUCS2("pt"))) cssUnit = eCSSUnit_Point; + else if (unit.Equals(NS_ConvertASCIItoUCS2("pc"))) cssUnit = eCSSUnit_Pica; else // unexpected unit return PR_FALSE; @@ -883,8 +883,9 @@ nsMathMLContainerFrame::ResolveMathMLCharStyle(nsIPresContext* aPresContext, nsAutoString data; aMathMLChar->GetData(data); PRBool isStretchy = nsMathMLOperators::MatchOperator(data, NS_MATHML_OPERATOR_STRETCHY); - nsAutoString fontStyle = (isStretchy) ? ":-moz-math-font-style-stretchy" - : ":-moz-math-font-style-anonymous"; + nsAutoString fontStyle = (isStretchy) ? + NS_ConvertASCIItoUCS2(":-moz-math-font-style-stretchy") : + NS_ConvertASCIItoUCS2(":-moz-math-font-style-anonymous"); nsCOMPtr fontAtom(getter_AddRefs(NS_NewAtom(fontStyle))); nsCOMPtr newStyleContext; nsresult rv = aPresContext->ResolvePseudoStyleContextFor(aContent, fontAtom, @@ -1008,8 +1009,8 @@ nsMathMLContainerFrame::InsertScriptLevelStyleContext(nsIPresContext* aPresConte // XXX seems not to decrease when the initail font-size is large (100pt) nsAutoString fontSize = (0 < gap) - ? ":-moz-math-font-size-smaller" - : ":-moz-math-font-size-larger"; + ? NS_ConvertASCIItoUCS2(":-moz-math-font-size-smaller") + : NS_ConvertASCIItoUCS2(":-moz-math-font-size-larger"); nsCOMPtr fontAtom(getter_AddRefs(NS_NewAtom(fontSize))); PRBool isSmaller = PR_TRUE; diff --git a/layout/mathml/base/src/nsMathMLmactionFrame.cpp b/layout/mathml/base/src/nsMathMLmactionFrame.cpp index 2308387bd855..b2f18aaf5bfd 100644 --- a/layout/mathml/base/src/nsMathMLmactionFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmactionFrame.cpp @@ -123,25 +123,28 @@ nsMathMLmactionFrame::Init(nsIPresContext* aPresContext, mActionType = NS_MATHML_ACTION_TYPE_NONE; if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::actiontype_, value)) { - if (value == "toggle") + if (value.EqualsWithConversion("toggle")) mActionType = NS_MATHML_ACTION_TYPE_TOGGLE; // XXX use goto to jump out of these if? if (NS_MATHML_ACTION_TYPE_NONE == mActionType) { - prefix = "tooltip#"; // expected tooltip prefix (8ch)... + // expected tooltip prefix (8ch)... + prefix.AssignWithConversion("tooltip#"); if (8 < value.Length() && 0 == value.Find(prefix)) mActionType = NS_MATHML_ACTION_TYPE_TOOLTIP; } if (NS_MATHML_ACTION_TYPE_NONE == mActionType) { - prefix = "statusline#"; // expected statusline prefix (11ch)... + // expected statusline prefix (11ch)... + prefix.AssignWithConversion("statusline#"); if (11 < value.Length() && 0 == value.Find(prefix)) mActionType = NS_MATHML_ACTION_TYPE_STATUSLINE; } if (NS_MATHML_ACTION_TYPE_NONE == mActionType) { - prefix = "restyle#"; // expected restyle prefix (8ch)... + // expected restyle prefix (8ch)... + prefix.AssignWithConversion("restyle#"); if (8 < value.Length() && 0 == value.Find(prefix)) { mActionType = NS_MATHML_ACTION_TYPE_RESTYLE; mRestyle = value; @@ -151,7 +154,7 @@ nsMathMLmactionFrame::Init(nsIPresContext* aPresContext, // given us the associated style. But we want to start with our default style. // So... first, remove the attribute actiontype="restyle#id" - value = ""; + value.SetLength(0); PRBool notify = PR_FALSE; // don't trigger a reflow yet! aContent->SetAttribute(kNameSpaceID_None, nsMathMLAtoms::actiontype_, value, notify); @@ -380,7 +383,9 @@ nsMathMLmactionFrame::MouseOver(nsIDOMEvent* aMouseEvent) if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::actiontype_, value)) { - nsAutoString statusline = "statusline#"; // expected statusline prefix (11ch)... + // expected statusline prefix (11ch)... + nsAutoString statusline; + statusline.AssignWithConversion("statusline#"); if (11 < value.Length() && 0 == value.Find(statusline)) { value.Cut(0, 11); ShowStatus(mPresContext, value); @@ -396,7 +401,8 @@ nsMathMLmactionFrame::MouseOut(nsIDOMEvent* aMouseEvent) // see if we should remove the status message if (NS_MATHML_ACTION_TYPE_STATUSLINE == mActionType) { - nsAutoString value = ""; + nsAutoString value; + value.SetLength(0); ShowStatus(mPresContext, value); } return NS_OK; @@ -412,7 +418,7 @@ nsMathMLmactionFrame::MouseClick(nsIDOMEvent* aMouseEvent) PRInt32 selection = (mSelection == mChildCount)? 1 : mSelection + 1; char cbuf[10]; PR_snprintf(cbuf, sizeof(cbuf), "%d", selection); - value = cbuf; + value.AssignWithConversion(cbuf); PRBool notify = PR_FALSE; // don't yet notify the document mContent->SetAttribute(kNameSpaceID_None, nsMathMLAtoms::selection_, value, notify); @@ -427,9 +433,9 @@ nsMathMLmactionFrame::MouseClick(nsIDOMEvent* aMouseEvent) if (node.get()) { if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::actiontype_, value)) - node->RemoveAttribute("actiontype"); + node->RemoveAttribute(NS_ConvertASCIItoUCS2("actiontype")); else - node->SetAttribute("actiontype", mRestyle); + node->SetAttribute(NS_ConvertASCIItoUCS2("actiontype"), mRestyle); } } } diff --git a/layout/mathml/base/src/nsMathMLmfencedFrame.cpp b/layout/mathml/base/src/nsMathMLmfencedFrame.cpp index 2475b69c8c3a..1e010d891205 100644 --- a/layout/mathml/base/src/nsMathMLmfencedFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmfencedFrame.cpp @@ -140,7 +140,7 @@ nsMathMLmfencedFrame::ReCreateFencesAndSeparators(nsIPresContext* aPresContext) else if (NS_CONTENT_ATTR_NOT_THERE == rv) data = '('; // default as per the MathML REC else - data = ""; + data = nsAutoString(); if (0 < data.Length()) { mOpenChar = new nsMathMLChar; @@ -160,7 +160,7 @@ nsMathMLmfencedFrame::ReCreateFencesAndSeparators(nsIPresContext* aPresContext) else if (NS_CONTENT_ATTR_NOT_THERE == rv) data = ')'; // default as per the MathML REC else - data = ""; + data = nsAutoString(); if (0 < data.Length()) { mCloseChar = new nsMathMLChar; @@ -180,7 +180,7 @@ nsMathMLmfencedFrame::ReCreateFencesAndSeparators(nsIPresContext* aPresContext) else if (NS_CONTENT_ATTR_NOT_THERE == rv) data = ','; // default as per the MathML REC else - data = ""; + data = nsAutoString(); mSeparatorsCount = data.Length(); if (0 < mSeparatorsCount) { diff --git a/layout/mathml/base/src/nsMathMLmfracFrame.cpp b/layout/mathml/base/src/nsMathMLmfracFrame.cpp index e1025890606b..bb4cbbfd6121 100644 --- a/layout/mathml/base/src/nsMathMLmfracFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmfracFrame.cpp @@ -111,21 +111,21 @@ nsMathMLmfracFrame::CalcLineThickness(nsIPresContext* aPresContext, nscoord minimumThickness = onePixel; if (0 < aThicknessAttribute.Length()) { - if (aThicknessAttribute.Equals("thin")) { + if (aThicknessAttribute.EqualsWithConversion("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("medium")) { + else if (aThicknessAttribute.EqualsWithConversion("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("thick")) { + else if (aThicknessAttribute.EqualsWithConversion("thick")) { lineThickness = NSToCoordCeil(defaultThickness * THICK_FRACTION_LINE); minimumThickness = onePixel * THICK_FRACTION_LINE_MINIMUM_PIXELS; // should visually increase by at least two pixels diff --git a/layout/mathml/base/src/nsMathMLmiFrame.cpp b/layout/mathml/base/src/nsMathMLmiFrame.cpp index 82b66d378567..89c11c238bfe 100644 --- a/layout/mathml/base/src/nsMathMLmiFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmiFrame.cpp @@ -131,13 +131,13 @@ nsMathMLmiFrame::SetInitialChildList(nsIPresContext* aPresContext, if (NS_CONTENT_ATTR_HAS_VALUE == mstyleContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::fontstyle_, fontStyle)) { - if (fontStyle.Equals("italic")) + if (fontStyle.EqualsWithConversion("italic")) return rv; } } // Get a pseudo style context for the appropriate style font - fontStyle.Assign(":-moz-math-font-style-normal"); + fontStyle.AssignWithConversion(":-moz-math-font-style-normal"); nsCOMPtr fontAtom(getter_AddRefs(NS_NewAtom(fontStyle))); nsCOMPtr newStyleContext; aPresContext->ResolvePseudoStyleContextFor(mContent, fontAtom, mStyleContext, diff --git a/layout/mathml/base/src/nsMathMLmoFrame.cpp b/layout/mathml/base/src/nsMathMLmoFrame.cpp index c0712c517be9..4faa4d0c7f98 100644 --- a/layout/mathml/base/src/nsMathMLmoFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmoFrame.cpp @@ -233,7 +233,7 @@ nsMathMLmoFrame::SetInitialChildList(nsIPresContext* aPresContext, nsMathMLAtoms::accent_, value)) { accentAttribute = PR_TRUE; - if (value.Equals("true")) + if (value.EqualsWithConversion("true")) { mEmbellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; } @@ -244,7 +244,7 @@ nsMathMLmoFrame::SetInitialChildList(nsIPresContext* aPresContext, nsMathMLAtoms::movablelimits_, value)) { movablelimitsAttribute = PR_TRUE; - if (value.Equals("true")) + if (value.EqualsWithConversion("true")) { mEmbellishData.flags |= NS_MATHML_EMBELLISH_MOVABLELIMITS; } @@ -301,9 +301,9 @@ nsMathMLmoFrame::InitData(nsIPresContext* aPresContext) PRBool hasEmbellishAncestor = PR_FALSE; if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::form_, value)) { - if (value == "prefix") + if (value.EqualsWithConversion("prefix")) aForm = NS_MATHML_OPERATOR_FORM_PREFIX; - else if (value == "postfix") + else if (value.EqualsWithConversion("postfix")) aForm = NS_MATHML_OPERATOR_FORM_POSTFIX; // flag if we have an embellished ancestor @@ -409,7 +409,9 @@ nsMathMLmoFrame::InitData(nsIPresContext* aPresContext) // For each attribute disabled by the user, turn off its bit flag. // movablelimits|separator|largeop|accent|fence|stretchy|form - nsAutoString kfalse("false"), ktrue("true"); + nsAutoString kfalse, ktrue; + kfalse.AssignWithConversion("false"); + ktrue.AssignWithConversion("true"); if (NS_MATHML_OPERATOR_IS_STRETCHY(mFlags)) { if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(mContent, mPresentationData.mstyle, nsMathMLAtoms::stretchy_, value) && value == kfalse) diff --git a/layout/mathml/base/src/nsMathMLmoverFrame.cpp b/layout/mathml/base/src/nsMathMLmoverFrame.cpp index 224c20c2fd02..77d9c6784a85 100644 --- a/layout/mathml/base/src/nsMathMLmoverFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmoverFrame.cpp @@ -142,7 +142,7 @@ XXX The winner is the outermost in conflicting settings like these: baseFrame->GetContent(getter_AddRefs(baseContent)); if (NS_CONTENT_ATTR_HAS_VALUE == baseContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::movablelimits_, value)) { - if (value == "true") { + if (value.EqualsWithConversion("true")) { mPresentationData.flags |= NS_MATHML_MOVABLELIMITS; } } @@ -172,8 +172,8 @@ XXX The winner is the outermost in conflicting settings like these: if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::accent_, value)) { - if (value == "true") embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value == "false") embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; aMathMLFrame->SetEmbellishData(embellishData); } diff --git a/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp b/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp index 59ef91deb371..617634b808ea 100644 --- a/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmpaddedFrame.cpp @@ -235,10 +235,10 @@ nsMathMLmpaddedFrame::ParseAttribute(nsString& aString, } aString.Right(value, stringLength - i); - if (value.Equals("width")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_WIDTH; - else if (value.Equals("height")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_HEIGHT; - else if (value.Equals("depth")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_DEPTH; - else if (value.Equals("lspace")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_LSPACE; + if (value.EqualsWithConversion("width")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_WIDTH; + else if (value.EqualsWithConversion("height")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_HEIGHT; + else if (value.EqualsWithConversion("depth")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_DEPTH; + else if (value.EqualsWithConversion("lspace")) aPseudoUnit = NS_MATHML_PSEUDO_UNIT_LSPACE; else // unexpected pseudo-unit { aCSSValue.Reset(); diff --git a/layout/mathml/base/src/nsMathMLmstyleFrame.cpp b/layout/mathml/base/src/nsMathMLmstyleFrame.cpp index 9ce95bb4bfd7..23751acbf337 100644 --- a/layout/mathml/base/src/nsMathMLmstyleFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmstyleFrame.cpp @@ -86,11 +86,11 @@ nsMathMLmstyleFrame::Init(nsIPresContext* aPresContext, nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::displaystyle_, value)) { - if (value == "true") { + if (value.EqualsWithConversion("true")) { mPresentationData.flags |= NS_MATHML_MSTYLE_WITH_DISPLAYSTYLE; mPresentationData.flags |= NS_MATHML_DISPLAYSTYLE; } - else if (value == "false") { + else if (value.EqualsWithConversion("false")) { mPresentationData.flags |= NS_MATHML_MSTYLE_WITH_DISPLAYSTYLE; mPresentationData.flags &= ~NS_MATHML_DISPLAYSTYLE; } diff --git a/layout/mathml/base/src/nsMathMLmunderFrame.cpp b/layout/mathml/base/src/nsMathMLmunderFrame.cpp index 45e9e10fe5b1..3c8c7013f096 100644 --- a/layout/mathml/base/src/nsMathMLmunderFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmunderFrame.cpp @@ -141,7 +141,7 @@ XXX The winner is the outermost setting in conflicting settings like these: baseFrame->GetContent(getter_AddRefs(baseContent)); if (NS_CONTENT_ATTR_HAS_VALUE == baseContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::movablelimits_, value)) { - if (value == "true") { + if (value.EqualsWithConversion("true")) { mPresentationData.flags |= NS_MATHML_MOVABLELIMITS; } } @@ -171,8 +171,8 @@ XXX The winner is the outermost setting in conflicting settings like these: if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::accentunder_, value)) { - if (value == "true") embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value == "false") embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; aMathMLFrame->SetEmbellishData(embellishData); } diff --git a/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp b/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp index 5939ce9a427a..1811d9f24171 100644 --- a/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp @@ -138,7 +138,7 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext, baseFrame->GetContent(getter_AddRefs(baseContent)); if (NS_CONTENT_ATTR_HAS_VALUE == baseContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::movablelimits_, value)) { - if (value.Equals("true")) { + if (value.EqualsWithConversion("true")) { mPresentationData.flags |= NS_MATHML_MOVABLELIMITS; } } @@ -168,8 +168,8 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext, if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::accentunder_, value)) { - if (value.Equals("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value.Equals("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; aMathMLFrame->SetEmbellishData(embellishData); } @@ -196,8 +196,8 @@ nsMathMLmunderoverFrame::SetInitialChildList(nsIPresContext* aPresContext, if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsMathMLAtoms::accent_, value)) { - if (value.Equals("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; - else if (value.Equals("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; + if (value.EqualsWithConversion("true")) embellishData.flags |= NS_MATHML_EMBELLISH_ACCENT; + else if (value.EqualsWithConversion("false")) embellishData.flags &= ~NS_MATHML_EMBELLISH_ACCENT; aMathMLFrame->SetEmbellishData(embellishData); } diff --git a/layout/mathml/content/src/nsMathMLAtoms.cpp b/layout/mathml/content/src/nsMathMLAtoms.cpp index b25f1763bb9e..dd1a634339ef 100644 --- a/layout/mathml/content/src/nsMathMLAtoms.cpp +++ b/layout/mathml/content/src/nsMathMLAtoms.cpp @@ -44,7 +44,7 @@ void nsMathMLAtoms::AddRefAtoms() { */ if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager))) // gNameSpaceManager->CreateRootNameSpace(namespace); - gNameSpaceManager->RegisterNameSpace(kMathMLNameSpace, nameSpaceID); + gNameSpaceManager->RegisterNameSpace(NS_ConvertASCIItoUCS2(kMathMLNameSpace), nameSpaceID); else NS_ASSERTION(0, "failed to create MathML atoms namespace manager"); diff --git a/layout/mathml/content/src/nsMathMLOperators.cpp b/layout/mathml/content/src/nsMathMLOperators.cpp index b7709661a4da..4ed96fe20212 100644 --- a/layout/mathml/content/src/nsMathMLOperators.cpp +++ b/layout/mathml/content/src/nsMathMLOperators.cpp @@ -238,8 +238,7 @@ nsMathMLOperators::LookupOperator(const nsCString& aOperator, float* aLeftSpace, float* aRightSpace) { - nsAutoString theOperator(aOperator); - return LookupOperator(theOperator,aForm,aFlags,aLeftSpace,aRightSpace); + return LookupOperator(aOperator,aForm,aFlags,aLeftSpace,aRightSpace); } PRBool