On Sun, Jul 13, Joe Crayne wrote:
Does this fix it?
--- source.cvs/src/dw_page.c 2003-07-12 14:17:12.000000000 -0400 +++ source.fix/src/dw_page.c 2003-07-13 00:16:32.000000000 -0400 @@ -451,7 +451,7 @@ static void Dw_page_get_extremes (DwWidg /* no rewrap necessary -> values in lines are up to date */ line = &page->lines[page->num_lines - 1]; if (page->words[line->first_word].style->nowrap) - extremes->min_width = MAX (line->max_word_min, line->par_min); + extremes->min_width = MAX (line->max_line_width, line->par_min); else extremes->min_width = line->max_word_min; extremes->max_width = MAX (line->max_par_max, line->par_max);
No, you cannot compare minimal widths (line->par_min) with actual widths (line->max_line_width), the problem is another one. I've just committed a fix, I'll summarize it here. The first part is: @@ -450,10 +450,11 @@ static void Dw_page_get_extremes (DwWidg } else if (page->wrap_ref == -1) { /* no rewrap necessary -> values in lines are up to date */ line = &page->lines[page->num_lines - 1]; - if (page->words[line->first_word].style->nowrap) - extremes->min_width = MAX (line->max_word_min, line->par_min); - else - extremes->min_width = line->max_word_min; + /* Historical note: The former distinction between lines with and without + * words[first_word]->nowrap set is no longer necessary, since + * Dw_page_real_word_wrap sets max_word_min to the correct value in any + * case. */ + extremes->min_width = line->max_word_min; extremes->max_width = MAX (line->max_par_max, line->par_max); } else { /* Calculate the extremes, based on the values in the line from Why it is not neccessary anymore, is clear from the second part (simplified): @@ -907,9 +916,15 @@ static void Dw_page_real_word_wrap (DwPa if (!new_par) last_line->par_max += last_space; if (word->style->nowrap) { last_line->par_min += word_extremes.min_width; + /* This may also increase the accumulated minimum word width. */ + last_line->max_word_min = + MAX (last_line->max_word_min, last_line->par_min); + /* NOTE: Most code relies on that all values of nowrap are equal for all + * words within one line. */ } else /* Simple case. */ last_line->max_word_min = MAX (last_line->max_word_min, word_extremes.min_width); Actually, this bug has existed for a longer time, what I assume (but did not investigate further) is that the fixed code was never used before, i.e. instead of handling this case: } else if (page->wrap_ref == -1) { /* no rewrap necessary -> values in lines are up to date */ [...] this case: } else { /* Calculate the extremes, based on the values in the line from where a rewrap is necessary. */ [...] was *always* handled, due to the rewrapping bug I fixed some time ago. So this bug was hid by another one. There is still another bug: At http://bbs.archlinux.org/viewtopic.php?t=771 the text is not rewapped sometimes. I'm working on it. Sebastain