From dd2750ace1992f46be8bf387621670cb39313921 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Fri, 10 Aug 2007 02:34:30 +0000 Subject: [PATCH] Oops, undoing unrelated change git-svn-id: svn://10.0.0.236/trunk@231775 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsTextFrameThebes.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/generic/nsTextFrameThebes.cpp b/mozilla/layout/generic/nsTextFrameThebes.cpp index ce992fb67e7..bf119a54d1a 100644 --- a/mozilla/layout/generic/nsTextFrameThebes.cpp +++ b/mozilla/layout/generic/nsTextFrameThebes.cpp @@ -5545,9 +5545,20 @@ nsTextFrame::Reflow(nsPresContext* aPresContext, // This is corrected for in nsLineLayout::TrimWhiteSpaceIn. PRInt32 numJustifiableCharacters = provider.ComputeJustifiableCharacters(offset, charsFit); + // Currently canTrimTrailingWhitespace is always true here + // because of the !textStyle->WhiteSpaceIsSignificant() test, + // but that could change... + if (canTrimTrailingWhitespace) { + // Count trimmed spaces and add them to the cluster count + PRUint32 charIndex = transformedOffset + transformedCharsFit; + while (charIndex > transformedOffset && + mTextRun->GetChar(charIndex - 1) == ' ') { + --charIndex; + } + } NS_ASSERTION(numJustifiableCharacters <= charsFit, - "Bad justifiable character count"); + "Justifiable characters combined???"); lineLayout.SetTextJustificationWeights(numJustifiableCharacters, charsFit - numJustifiableCharacters); }