Andre Poenitz wrote:

> On Thu, Nov 13, 2003 at 10:15:03AM +0000, Angus Leeming wrote:
>> Andre Poenitz wrote:
>> > Is that else-branch equivalent to
>> > 
>> >                  } else {
>> >                     doInsertInset(this, cmd, true, false);
>> >                  }
>> >                  break;
>> 
>> Depends what doInsertInset does with cmd doesn't it... Ie, does it
>> check that it is dealing with LFUN_INSET_INSERT or not?
>> 
>> I don't have the sources to hand. Can you tell me which file
>> doInsertInset is to be found in and I'll have a look using the
>> viewcvs web interface.
> 
> text3.C

Hmmm. and where is LFUN_INSET_APPLY currently handled? It certainly 
isn't in LyXText::dispatch and it does exist somewhere...

Ok, got it. It's in BufferView_pimpl.C.

Martin, I note that your patch doesn't delete this copy of the LFUN 
handler. If you're going to add it to LyxText::dispatch you should 
remove it from BufferView::Pimpl::dispatch shouldn't you?

In fact, what is wrong with the current code in 
BufferView::Pimpl::dispatch?

        case LFUN_INSET_APPLY: {
                string const name = ev.getArg(0);

                InsetBase * inset = owner_->getDialogs().getOpenInset(name);
                if (inset) {
                        // This works both for 'original' and 'mathed' insets.
                        // Note that the localDispatch performs update also.
                        FuncRequest fr(bv_, LFUN_INSET_MODIFY, ev.argument);
                        inset->dispatch(fr);
                } else {
                        FuncRequest fr(bv_, LFUN_INSET_INSERT, ev.argument);
                        dispatch(fr);
                }
        }
        break;

        case LFUN_INSET_INSERT: {
                InsetOld * inset = createInset(ev);
                if (!inset || !insertInset(inset))
                        delete inset;
                break;
        }


-- 
Angus

Reply via email to