Third time lucky! Not Dispatch(...CREATE) but Dispatch(..INSERT)
Sorry,
A

On Thursday 07 December 2000 11:00, Angus Leeming wrote:
Sorry, got that wrong. The inserted code should be under
LFUN_CITATION_CREATE of couse and would simply bypass the createCitation
call:

In LyXFunc::Dispatch():

        case LFUN_CITATION_CREATE:
        {
                InsetCommandParams p( "cite" );

                if (!argument.empty()) {
                        if (contains(argument, "|")) {
                                p.setContents( token(argument, '|', 0) );
                                p.setOptions(  token(argument, '|', 1) );
                        } else {
                                p.setContents( argument );
                        }
                        Dispatch(LFUN_CITATION_INSERT, p.getAsString());
                else
                        owner-getDialogs()-createCitation( p.getAsString() );
        }
        break;

        case LFUN_CITATION_INSERT:
        {
                InsetCommandParams p;
                p.setFromString( argument );

                InsetCitation * inset = new InsetCitation( p );
                if (!owner-view()-insertInset(inset))
                        delete inset;
                else
                        owner-view()-updateInset( inset, true );
        }
        break;

Can you test this?
A

Reply via email to