On Fri, Oct 24, 2003 at 01:19:43PM +0200, Alfredo Braunstein wrote:
> Andre Poenitz wrote:
>
> > Could you please send patches as attachment? They arrive somewhat broken
> > here.
> >
> > Look e.g. at the line starting with '> endl;' below. THis should belong
> > to the line above.
>
> It must be the mua autobreak "feature", Sorry.
> Attached now.
Works.
And I can't neither crash it nor get strange debug output.
So you could as well commit it.
PS: As there seems to be some special casing needed for empty pars (we
need at least one row after all...) maybe instead of
@@ -1895,7 +1902,8 @@ void LyXText::redoParagraphInternal(Para
// rebreak the paragraph
int const ww = workWidth();
- for (pos_type z = 0; z < pit->size() + 1; ) {
+ pos_type z = 0;
+ do {
Row row(z);
rowBreakPoint(pit, row);
z = row.endpos();
@@ -1906,7 +1914,8 @@ void LyXText::redoParagraphInternal(Para
pit->rows.push_back(row);
pit->width = std::max(pit->width, row.width());
pit->height += row.height();
- }
+ } while (z < pit->size());
+
something like
if (pit->size())
old for-loop
else
push_back(single empty row)
would be closer to the intention. This way, the check you added to the
beginning of rowBreakPoint would not be needed as well.
But you could as well just commit what you have and I brush over it the
next time I come along ;-)