Le 21/11/2011 03:20, Richard Heck a écrit :
You have to call recordUndoFullDocument (should be
recordUndoBufferParams, but alas this does not exist) on the master
buffer, then. But I do not see where is the magic code that gives the
master buffer.

I'll have a look at this. Before I do, is there any interaction between
this kind of thing and the whole ReadOnly issue? I.e., we have undo with
read-only documents?

When a function which requires a buffer (== does not have the NoBuffer flag) does not have the ReadOnly flag, it is disabled as soon as the document is in read-only mode. In the old days, this was used as a signal for making a buffer dirty, but this has changed when fixing #3733.
http://www.lyx.org/trac/ticket/3733

Now, we set buffer dirty in reordUndo calls, which seems to make more sense.

For branch activation, I would propose to first add a call to recordUndoFullDocument, which would be easier by moving the handler to BufferView.cpp (for now), until we sort out what to do with the undo helper. What we really need is a way to save the BufferParams only, not the buffer params plus the whole ParagraphList. The only problem is that this function requires a Cursor, which we do not have in Buffer.cpp.

As far as making this function available in read-only mode, I propose to keep it for later (when somebody asks for it?).

JMarc

Reply via email to