>>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:

Martin> The attached patch is perhaps more what you had in mind. It
Martin> forces the selectionBegin and selectionEnd iterators to be of
Martin> the same depth. Works for both cases: selecting to the left
Martin> and to the right. I believe that covers all bases.

I do not understand what you are doing. CursorSlice::operator< is
supposed to assert if the slices are not on the same inset. So if you
code works, it means that top() and anchor() do point to the same
inset. So which is the resize useful?

Hmmm... I see, this is the special code in anchor():

CursorSlice LCursor::anchor() const
{
        BOOST_ASSERT(anchor_.depth() >= depth());
        CursorSlice normal = anchor_[depth() - 1];
        if (depth() < anchor_.depth() && top() <= normal) {
                // anchor is behind cursor -> move anchor behind the inset
                ++normal.pos();
        }
        return normal;
}

Aren't you supposed to play similar ++ tricks like that?

And why is it true that anchor_.depth() >= depth().

It seems to me that uses of selBegin/End are safe, but that
selectionBegin/End (which are used much less often) may be broken.

JMarc

Reply via email to