Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:
What about removing the second parameter altogether? What are the
cases when add() can be called with view == 0?
Abdelrazak> in expandToc2:
Abdelrazak> In expandToc:
Abdelrazak> etc...
I think it is not passed there because I was lazy and confident that
the entries would be enabled anyway. Going through getStatus
unconditionally should not hurt.
I do not think the buffer parameter has any use here.
Abdelrazak> The only use is there:
Abdelrazak> Menu & Menu::add(MenuItem const & i, Buffer const * buf) {
Abdelrazak> You can see here that the passed Buffer (or LyXView in the
Abdelrazak> old code) is just there to differentiate between two
Abdelrazak> methods.
It is not two methods. In the old code, I needed to call
view->getLyXFunc().getStatus, which only makes sense when view is not
NULL. But I am not sure that this can happen (that there is no view at
all, I mean).
The situation now is that add() is able to find the LyXFunc by itself,
so that there is no need to pass it as an argument.
So I think the parameter (and the test) should be removed.
Yes, I understand, see my other patch. Agreed?
Abdel.