Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

 Simplified? The patch seems rather mechanical to me... What
changes do you have in mind?

Abdelrazak> I just mean that I simplified the interface of these
Abdelrazak> expand functions (no Buffer passing) that's all.

This is fine. Actually the remaining buffer passing points to a
strangeness in your new setting. Some functions like add() do not need
a buffer argument because theApp knows what the current buffer is.

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

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?

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

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


Anyway, either there is a notion of current buffer(view), or we pass
buffer(view)s as parameters everywhere.

The theApp does know what is the current Buffer is for now but this is a temporary thing for the need of the Selection and Clipboard features.

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

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

You don't want to use that ;-) I prefer to pass explicitely what I need and not rely on some indirection that may change in the feature. You may have noticed that most of my cleanup work is about removing the need for these indirections. You don't want me to re-introduce that do you? ;-)


Abdelrazak> I am not sure I understand what you mean here. Do you want
Abdelrazak> a single function that does the check in any case? If yes,
Abdelrazak> I am OK with that too and I don't think that there will be
Abdelrazak> a noticeable performance penalty.

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

I'll do the change then.

Abdel.

Reply via email to