Bail out of nsTextFrame::MeasureText() early when contentLength is 0. Bug 129847, r=sfraser, sr=rbs.

This commit is contained in:
smontagu%netscape.com 2003-02-26 01:33:03 +00:00
parent 6327857377
commit 5b7a71b0ea
2 changed files with 14 additions and 0 deletions

View File

@ -4720,6 +4720,13 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
PRBool justDidFirstLetter = PR_FALSE;
nsTextDimensions dimensions, lastWordDimensions;
PRBool measureTextRuns = PR_FALSE;
if (contentLength == 0) {
aTextData.mX = 0;
aTextData.mAscent = 0;
aTextData.mDescent = 0;
return NS_FRAME_COMPLETE;
}
#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11)
// see if we have implementation for GetTextDimensions()
PRUint32 hints = 0;

View File

@ -4720,6 +4720,13 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
PRBool justDidFirstLetter = PR_FALSE;
nsTextDimensions dimensions, lastWordDimensions;
PRBool measureTextRuns = PR_FALSE;
if (contentLength == 0) {
aTextData.mX = 0;
aTextData.mAscent = 0;
aTextData.mDescent = 0;
return NS_FRAME_COMPLETE;
}
#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11)
// see if we have implementation for GetTextDimensions()
PRUint32 hints = 0;