Re: Summary (was Re: asserts and pagebreaks)


Subject: Re: Summary (was Re: asserts and pagebreaks)
From: Jesper Skov (jskov@redhat.com)
Date: Tue May 23 2000 - 15:22:07 CDT


>>>>> "Mike" == Mike Nordell <tamlin@algonet.se> writes:

>> I've been pondering a rewrite where the Runs return "inside" or
>> "I'm-past-the-point-you-are-looking-for". In the latter case,
>> return the previous (text) Run coords.

Mike> Please don't, I'd rather see that its owner handles this. A run
Mike> should IMO *only* know about itself, its position on the
Mike> fp_Line, its DocPos wrt the block and a few other things. It
Mike> should know nothing about other runs (in a perfect world).

But as far as I can tell, you cannot achieve the desired semantics
(in the current design anyway) without the Runs being able to tell
either that you can expect to get a hit next time, or that you are
past what you are looking for.

A simple true/false return will not work since you'll be scanning
along from the start of the block looking for a 'true' to
terminate. Only, if (as is the case with the problem that got me
started on this) the requested position is a pageBreak, it will have
to return false (as it cannot hold the point). Thus the loop will
never terminate.

A possible alternative implementation would be to have the Run return
the positions it spans (i.e., a range) and whether it can contain the
IP - the algorithm I outlined in the previous mail would still work
then, it'd only have to do the position checking instead of letting
the Runs do it.

Like that better? Or did you have something else in mind?

Btw, I still haven't looked at your cursor class - I'm sure it'll be
enlightening given how little I understand of all this :)

Cheers,
Jesper



This archive was generated by hypermail 2b25 : Tue May 23 2000 - 15:22:24 CDT