From b6df49e082a820ef8ebb8a4949f68cc8c4ee7eaf Mon Sep 17 00:00:00 2001 From: "rbs%maths.uq.edu.au" Date: Wed, 19 Oct 2005 00:57:17 +0000 Subject: [PATCH] Bug 191847,297464, allow negative widths in for uses like overstriking, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@182512 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/mathml/base/src/nsMathMLFrame.cpp | 17 ++++++++++++++--- .../mathml/base/src/nsMathMLmspaceFrame.cpp | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp index 7df48c16457..d2bd6623105 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp @@ -330,7 +330,7 @@ The REC says: % percentage of default value Implementation here: - The numeric value is valid only if it is of the form nnn.nnn [h/v-unit] + The numeric value is valid only if it is of the form [-] nnn.nnn [h/v-unit] */ /* static */ PRBool @@ -346,10 +346,21 @@ nsMathMLFrame::ParseNumericValue(nsString& aString, nsAutoString number, unit; + // see if the negative sign is there + PRInt32 i = 0; + PRUnichar c = aString[0]; + if (c == '-') { + number.Append(c); + i++; + + // skip any space after the negative sign + if (i < stringLength && nsCRT::IsAsciiSpace(aString[i])) + i++; + } + // Gather up characters that make up the number PRBool gotDot = PR_FALSE; - PRUnichar c; - for (PRInt32 i = 0; i < stringLength; i++) { + for ( ; i < stringLength; i++) { c = aString[i]; if (gotDot && c == '.') return PR_FALSE; // two dots encountered diff --git a/mozilla/layout/mathml/base/src/nsMathMLmspaceFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmspaceFrame.cpp index 6b74533d591..8f34fa64e39 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmspaceFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmspaceFrame.cpp @@ -135,6 +135,8 @@ nsMathMLmspaceFrame::Reflow(nsPresContext* aPresContext, mBoundingMetrics.width = mWidth; mBoundingMetrics.ascent = mHeight; mBoundingMetrics.descent = mDepth; + mBoundingMetrics.leftBearing = 0; + mBoundingMetrics.rightBearing = mWidth; aDesiredSize.ascent = mHeight; aDesiredSize.descent = mDepth;