Sorry, I didn't send the message to the list.

João.

----------  Mensagem reenviada  ----------

Subject: Re: DVI search.
Date: Qua 01 Mar 2006 11:20
From: João Luis Meloni Assirati <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]

Em Qua 01 Mar 2006 10:03, Martin Vermeer escreveu:
> On Wed, 2006-03-01 at 08:20 -0300, João Luis Meloni Assirati wrote:
> > Hello,
> >
> > Now that lyx is very close to a release, I publish again in this list my
> > dvi search patch. I intend to maintain this patch for all releases of the
> > 1.4 series as long as it remain useful to me. I hope that it can be
> > useful to others too, and that's why I am sending it to this list and
> > will send it to lyx-users when 1.4 come out. As in previous times, any
> > comment, suggestion or bug report will be very welcome.
>
> While I am not the best person to provide critique, here some remarks.
>
> In TexRow::getRowFromId:
>
>       int new_diff_id = abs(cit->id() - id);
> ...
>       int new_diff_pos = abs(cit->pos() - pos);
>
> Could std::distance be used here? The assumption seems to be that id is
> a linear counter.

Yes, but all functions in texrow use integers like id, pos, etc. I think it
 is best to keep this language than introduce a functions that gets iterators
 as arguments.

> More generally this logic looks convoluted to me. Isn't the idea to
> find, for all TeX rows in the document, the row that contains the
> position closest to the given (id, pos) pair?

Yes, it is.

> Can it really be this
> complicated?

Maybe TexRow::getRowFromId is somewhat baroque, but it tries its best to find
the closest position.

> Ignore me if I am talking bs.

You are not!

> - Martin

Thank you, Martin.

João.

-------------------------------------------------------

Reply via email to