>>>>> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

Abdelrazak> No, add() do need to know what the current Buffer is, it
Abdelrazak> just need some FuncRequest status via
Abdelrazak> theApp->lyxFunc().getStatus().

Yes, but getStatus knows what the current buffer is.

>> However, some other functions need this buffer passing because
>> theApp won't tell what the current buffer is. Aren't we
>> reintroducing the dreaded current_view thingy?

Abdelrazak> AFAIS, these functions needs this Buffer passing for
Abdelrazak> specific purpose:

Abdelrazak> - expandFormats needs to know if there is an opened
Abdelrazak> document currently and for the need of Exporter functions.
Abdelrazak> - expandFloatListInsert() and expandFloatInsert() need
Abdelrazak> some float list from the buffer. Actually they just need a
Abdelrazak> BufferParams.

The question is: how are we sure that the buffer that is passed as
parameter is the same than the one theApp knows about? What are the
semantics of these two buffers? If we are doing some processing on a
document which is not the current one, how do we make sure that all
functions rely on the right document?

On nice way of providing context is to pass a cursor. It conveys a lot
of information related to this. But it is not always practical.

Abdelrazak> But in the feature there would be indeed a notion of
Abdelrazak> "current Buffer" accessible through:

theApp-> currentView()->currentWorkArea()->bufferView()->buffer()

This is what I mean when I say that theApp knows these things.

Abdelrazak> You don't want to use that ;-) I prefer to pass
Abdelrazak> explicitely what I need and not rely on some indirection
Abdelrazak> that may change in the feature. 

This makes sense only if you are sure that those two informations are
the same.

Abdelrazak> You may have noticed that most of my cleanup work is about
Abdelrazak> removing the need for these indirections. You don't want
Abdelrazak> me to re-introduce that do you? ;-)

In the case of MenuBackend, you remove the explicit view argument and
use (hidden) indirection via lyxApp instead. It might not be the
wisest thing to do after all.

>>  Yes, I'd prefer a single function that does the check in any case.

Abdelrazak> I'll do the change then.

Thanks.

JMarc

Reply via email to