On Wed, Oct 22, 2003 at 11:10:49AM +0300, Martin Vermeer wrote:
> >   You are right, I don't get an assert this time is real, it is a crash. ;-)
> > (gdb) run
> > Starting program: /home/jamatos/lyx/lyx-devel/src/lyx-xforms
> > text not available!
> > no text in cache!
> 
> ...
> 
> > #1  0x0811050e in Paragraph::isNewline(int) const ()
> > #2  0x0812e5f7 in LyXText::prepareToPrint(std::_List_iterator<Paragraph, 
> 
> Yes, this is a different problem. I get it too now, but not yesterday
> evening. Here:
> 
>    1480             // If we have separators, this is not the last row of a
>    1481             // par, does not end in newline, and is not row above a
>    1482             // display inset... then stretch it
>    1483             if (ns
>    1484                 && rit->end() < pit->size()
>    1485                 && !pit->isNewline(next_row->pos()- 1)
>    1486                 && !disp_inset
>    1487                 ) {
>    1488                     fill_separator = w / ns;
>    1489             } else if (is_rtl) {
>    1490                 x += w;
>    1491             }
> 
> It crashed on the isNewline() on line 1485, because next_row->pos()
> seems to contain nonsense (it should point to the first char of this
> row within its par). Adding a printout confirms this: either 0 or a
> very large value.

next_row()->pos() - 1   should be replaced by row.end() nowadays.

By construction, these values should be equal (id existent):

        for (pos_type z = 0; z < pit->size() + 1; ) {
                Row row(z);
                z = rowBreakPoint(pit, row) + 1;
                row.end(z);
                ...
        }


Andre'


-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to