Alfredo Braunstein wrote:
Abdelrazak Younes wrote:
fixIfBroken). But I don't really understand why you think the signal
solution is bad. This is the *only* way to ensure that the inset pointer
inside CursorSlice is valid at any time. Even with Alfredo solution you
could end up with an invalid pointer if you forgot to call fixIfBroken().
But you'll still end up with an invalid cursor if you forget to call
fixIfbroken,
Right but this case would be detected by an assertion whereas using an
invalid inset pointer will crash LyX very badly.
so there's no point in keeping the pointers valids, right?
I am not sure. The point is to make sure that we know if a CursorSlice
is valid or not. Your idea about comparing the address of the current
inset with the one listed in the insetlist of the enclosing paragraph in
order to verify that the pointer address is valid might work. I am just
saying that the signal approach is safer, that's all.
Abdel.