On Sat, Mar 22, 2003 at 03:33:16PM +0100, Alfredo Braunstein wrote: > Is _much_ less meaningless IMO than to return 0 (which is indeed a valid > return value for 1 char paragraphs).
It is also valid for empty paragraphs. Its semantics mean "if you look in getChar(lastPos()), you'll find something, unless it's an empty paragraph". Now, before, we did that by returning -1 in the empty case, and we had all sorts of bits of code getting it dead wrong and accessing places it shouldn't. > Think of it as a reverse_iterator that points at the end (i.e. > rend()): it should be -1! Now why should we think of it like that ? That is *not* what it is. If you want to move the whole pos access over to proper STL style iterators, fine, but your patch does not do that. > > And yes, I specifically changed this to return 0 not -1, because *it was > > causing bugs*. > > Where? You expect me to remember !! > > computeBidiTables must be fixed. > > AFAIC it's not only computeBidiTables, i was getting crashes also on the > table code that I don't get any more (not investigated so much, though) Harrumph, this sounds like knock-on effects. I did quite some table testing of this when I made the change as part of the change tracking stuff (which basically required it in order for sanity to prevail) regards, john