From 5c82c57502442f4066d143e619b37d3ef6cd9e45 Mon Sep 17 00:00:00 2001 From: "rbs%maths.uq.edu.au" Date: Mon, 5 Feb 2001 13:39:20 +0000 Subject: [PATCH] Remove gratuitous parentheses in a declaration, and allow trailing #comments in MathFont Property Files git-svn-id: svn://10.0.0.236/trunk@86224 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/mathml/base/src/nsMathMLChar.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp index 72c3f3e39cb..574859521ec 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp @@ -262,8 +262,11 @@ nsGlyphTable::ElementAt(nsMathMLChar* aChar, PRUint32 aPosition) nsAutoString key, value; key.AssignWithConversion(cbuf); nsresult rv = mGlyphProperties->GetStringProperty(key, value); if (NS_FAILED(rv)) return 0; + // Chop the trailing # portion if any ... + PRInt32 comment = value.RFindChar('#'); + if (comment > 0) value.Truncate(comment); + value.CompressWhitespace(); mGlyphCache.Assign(value); - mGlyphCache.CompressWhitespace(); mCharCache = ch; } @@ -556,7 +559,7 @@ StretchyFontEnumCallback(const nsString& aFamily, PRBool aGeneric, void *aData) for (PRInt32 i = 0; i < gGlyphTableList->Count(); i++) { nsGlyphTable* glyphTable = (nsGlyphTable*)gGlyphTableList->ElementAt(i); if (kNotFound == currList->IndexOf(glyphTable)) { // avoid duplicates - nsAutoString(fontName); + nsAutoString fontName; glyphTable->GetFontName(fontName); if (fontName.EqualsIgnoreCase(aFamily) && glyphTable->Has(currChar)) { currList->AppendElement(glyphTable); // the table is retained