On Wed, Sep 27, 2006 at 03:17:34PM +0200, Jean-Marc Lasgouttes wrote: > 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.
I recently wondered whether the current Cursor is The Right Thing. It has 'model' parts (points to a place in a doc), yet also conveys 'view' information in .bv(). I guess in the long run this is not ideal... And yes, I know who's to blame... > 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. Indeed. This is no advantage. Better pass stuff down as arguments instead of relying on globals. theApp->xxx is indeed current_view in disguise. Andre'