Bug 385426. Be careful about looking for a previous soft-hyphen when checking for hyphen breaks. r=smontagu

This commit is contained in:
roc+@cs.cmu.edu 2007-08-29 02:11:39 -07:00
parent 56fd1888c8
commit 03e055e67f

View File

@ -2547,9 +2547,11 @@ PropertyProvider::GetHyphenationBreaks(PRUint32 aStart, PRUint32 aLength,
// We need to visit skipped characters so that we can detect SHY
run.SetVisitSkipped();
PRInt32 prevTrailingCharOffset = run.GetPos().GetOriginalOffset() - 1;
PRBool allowHyphenBreakBeforeNextChar =
run.GetPos().GetOriginalOffset() > mStart.GetOriginalOffset() &&
mFrag->CharAt(run.GetPos().GetOriginalOffset() - 1) == CH_SHY;
prevTrailingCharOffset >= mStart.GetOriginalOffset() &&
prevTrailingCharOffset < mStart.GetOriginalOffset() + mLength &&
mFrag->CharAt(prevTrailingCharOffset) == CH_SHY;
while (run.NextRun()) {
NS_ASSERTION(run.GetRunLength() > 0, "Shouldn't return zero-length runs");