On Fri, Oct 24, 2003 at 11:27:20AM +0200, Alfredo Braunstein wrote:
> I may be reading wrongly the code, but but seems to me that rowbreakpoint
> sets row.endpos() to a value larger ny 1 than it should.

Yes.

> I.e. (text.C:LyXText::rowBreakPoint)
> 
>         if (width < 0) {
>                 row.endpos(pit->size() + 1);
>                 return;
>         }
> 
> 
> or below
> 
> pos_type const last = pit->size();
> pos_type point = last;
> 
> if (pos == last) {
>         row.endpos(last + 1);
>         return;
> }
> 
> There's more evidence that this was on purpose (lyxrow_funcs.C):
> 
> pos_type lastPos(Paragraph const & par, Row const & row)
> {
>         if (par.empty())
>                 return 0;
>         pos_type pos = row.endpos() - 1;
>         if (pos == par.size())
>                 --pos;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this shouldn't be here
>         return pos;
> }
> 
> 
> I don't understand what's happening. Shouldn't row.endpos() be par->size()
> if the par is small enough? Someone can explain to the thicko here?

That's the +/-1 game I was refering to in a discussion a day or two
ago (the one that ended in total confusion). endpos setting uses wrong
values just to provide the opportunity to correct them later.

It's complete nonsense but somehow not easily accessible to a 'small
steps' change. But it should go. 

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