Cleanup and flags for debug mode

git-svn-id: svn://10.0.0.236/trunk@58937 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rbs%maths.uq.edu.au
2000-01-27 12:38:03 +00:00
parent 7fd7ce0e80
commit 2aa8ed388f
8 changed files with 24 additions and 10 deletions

View File

@@ -171,9 +171,12 @@ Implementation here:
// Adapted from nsCSSScanner.cpp & CSSParser.cpp
PRBool
nsMathMLContainerFrame::ParseNumericValue(const nsString& aString,
nsCSSValue& aCSSValue)
nsMathMLContainerFrame::ParseNumericValue(nsString& aString,
nsCSSValue& aCSSValue)
{
aCSSValue.Reset();
aString.CompressWhitespace(); // aString is not a const in this code...
PRInt32 stringLength = aString.Length();
if (!stringLength) return PR_FALSE;
@@ -232,7 +235,7 @@ printf("String:%s, Number:%s, Unit:%s\n", s1, s2, s3);
else if (unit == "pc") cssUnit = eCSSUnit_Pica;
else // unexpected unit
return PR_FALSE;
aCSSValue.SetFloatValue(floatValue, cssUnit);
return PR_TRUE;
}
@@ -896,6 +899,7 @@ nsMathMLContainerFrame::InsertScriptLevelStyleContext(nsIPresContext* aPresConte
* =============================================================================
*/
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
NS_IMETHODIMP
nsMathMLContainerFrame::Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
@@ -908,7 +912,6 @@ nsMathMLContainerFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext,
aDirtyRect,
aWhichLayer);
#ifdef SHOW_BOUNDING_BOX
// for visual debug
// ----------------
// if you want to see your bounding box, make sure to properly fill
@@ -928,9 +931,9 @@ nsMathMLContainerFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.DrawRect(x,y,w,h);
}
#endif
return rv;
}
#endif
NS_IMETHODIMP
nsMathMLContainerFrame::Init(nsIPresContext* aPresContext,

View File

@@ -156,11 +156,13 @@ public:
return nsHTMLContainerFrame::DidReflow(aPresContext, aStatus);
}
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
NS_IMETHOD
Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
#endif
// helper function to reflow token elements
static nsresult
@@ -271,8 +273,8 @@ public:
// utilities to parse and retrieve numeric values in CSS units
// All values are stored in twips.
static PRBool
ParseNumericValue(const nsString& aString,
nsCSSValue& aCSSValue);
ParseNumericValue(nsString& aString,
nsCSSValue& aCSSValue);
static nscoord
CalcLength(nsIPresContext* aPresContext,

View File

@@ -99,7 +99,9 @@ nsMathMLmmultiscriptsFrame::Init(nsIPresContext* aPresContext,
}
}
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
#endif
return rv;
}

View File

@@ -119,7 +119,7 @@ nsMathMLmoFrame::Paint(nsIPresContext* aPresContext,
rv = mMathMLChar.Paint(aPresContext,
aRenderingContext,
mStyleContext);
#ifdef SHOW_BOUNDING_BOX
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
// for visual debug
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer &&
NS_MATHML_PAINT_BOUNDING_METRICS(mPresentationData.flags))
@@ -159,7 +159,9 @@ nsMathMLmoFrame::Init(nsIPresContext* aPresContext,
mMinSize = float(NS_UNCONSTRAINEDSIZE);
mMaxSize = float(NS_UNCONSTRAINEDSIZE);
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
#endif
return rv;
}

View File

@@ -90,7 +90,9 @@ nsMathMLmsubFrame::Init(nsIPresContext* aPresContext,
}
}
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
#endif
return rv;
}

View File

@@ -99,7 +99,9 @@ nsMathMLmsubsupFrame::Init(nsIPresContext* aPresContext,
}
}
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
#endif
return rv;
}

View File

@@ -89,7 +89,9 @@ nsMathMLmsupFrame::Init(nsIPresContext* aPresContext,
}
}
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
#endif
return rv;
}

View File

@@ -72,8 +72,7 @@ protected:
private:
nscoord mScriptSpace; // scriptspace from TeX for extra spacing after sup/subscript
// = 0.5pt in plain TeX
float mSupScriptShiftFactor;
PRBool mUserSetFlag;
nscoord mSupScriptShift;
};
#endif /* nsMathMLmsupFrame_h___ */