rgheck wrote:
Jean-Marc Lasgouttes wrote:
rgheck <[EMAIL PROTECTED]> writes:

OK. So, let me ask the question I asked in another message: Should I
just add LFUN_BRANCH_ACTIVATE to BufferView::dispatch() for now, and
we can deal with this mess later? With Beta 1 on the horizon, it
doesn't seem like the right time to mess with this part of the code.

You can do that right now and we'll see how painful it is to cleanup.

OK. One other thing, then, before I try to do this. In Application.h, Abdel says that BufferView should provide only const access to its Buffer.
That's in an ideal world.

If I try to call Buffer::dispatch() from LyXFunc.h, then I'll need to do something like:
view()->buffer()->dispatch(cmd);
which will depend upon non-const access. Is this bad?
Not really but see below what I would do:

If so, what to do?

At the top of LyXFunc::dispatch(), define
a temporary Buffer pointer:

Buffer * buf = 0;

if (theApp->dispatch())
...
if (LyXView()->dispatch())
...
if (BufferView::dispatch()) {
   buf = view()->buffer();
...
} else {
 // this is the case were there is no frontend available.
  buf = <retrieve the Buffer from theBufferList()>
}

if (buf->dispatch())
...

Abdel.

Reply via email to