>>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:

Georg> Jean-Marc Lasgouttes wrote:
>> Just a remark:
>> 
>> case LFUN_INSET_INSERT: { //lyxerr << "arg: " << cmd.argument <<
>> endl; string const name = cmd.getArg(0); - if (name == "label") {
>> 
>> It would be better to assert on `name == "label"'.

Georg> Don't you trust the getStatus machinery? From the last
Georg> discussions we had about this topic I remember that
Georg> doDispatch() cannot be called if getStatus says so. Is my
Georg> memory wrong?

The problem is that this text is done in lyxfunc::dispatch only, so it
is possible to bypass the checks by calling directly the wrong
dispatch command. For example, the workaread calls (called?) directly
BufferView::dispatch.

The extra asserts does not hurt, and it is also very useful for the
fellow developpers to understand what the prerequisites are. Without
that nobody can guess that this is label code.

JMarc

Reply via email to