Vincent van Ravesteijn wrote:
rgheck schreef:
I'd rather not just restore the setBuffer calls, since doing so means
going through the entire document and setting every single inset's
buffer_ member every time we call updateLabels(), which just seems
excessive. So I instead propose the attached.
Hmm.. it still feels like surrendering.. now we don't call setBuffer
every time, but we do call it for every inset. I'd rather like to see
a solution that ensures that all buffer_ members are set at the same
time when they are inserted/pasted/copied/undo'ed (is this correct
english ?)
Why don't you do the same in Undo.cpp as you did it CutAndPaste.cpp ?
Or is this not possible or difficult ?
Yes, I know it seems wrong. But I don't immediately see how to do it in
Undo. That said, the best thing to do here is probably to encapsulate
the badness here in a separate function Buffer::setBufferForInsets(),
and then it can be called explicitly when it is needed...which means
we'll also know where it is needed and can get rid of it later. I've
committed something like that.
That said, the place it would need to be done, I take it, is
doTextUndoOrRedo().
Richard