Abdelrazak Younes wrote:
Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

Abdelrazak> Abdelrazak Younes wrote:
Ozgur Ugras BARAN wrote:
This small patch prevents LOF, LOT always selects the last entry.
LOT/LOF still does not follow the cursor, yet, but for this, we
need serious update in TocBackend.
 Not that much work IMO. The problem is the way we search for the
toc item is very crude. Look at the comment in TocBackend::item():

// A good solution for Items inside insets would be to do: // //if
(std::distance(it->par_it_, current) <= 0) // return it; // // But
for an unknown reason, std::distance(current, it->par_it_) always
// returns a positive value and std::distance(it->par_it_, current)
// takes forever... // So for now, we do: if (it->par_it_.pit() <=
par_it_text.pit()) return it;

This is not correct and will work only for top-level items. So if
someone could implement an <= operator for ParConstIterator, that
would solve our problem. Jean-Marc, Andre, your the experts in this
field, could you implement this:

bool operator<=(ParConstIterator const &, ParConstIterator const
&);

Abdelrazak> I've done it but I am not sure I got it right. JMarc?

Here is what I have. Not tested (not even sure it compiles). I use the
operator< for cursor slice, that looks both at pit and pos.

Doesn't seem to work... operator<= always return false.

That was because the DocIterator::void*() operator was used. So the adress were compared instead...
Declaring the comparison operator as friend in the class is thus necessary.

Abdel.


Reply via email to