Martin Vermeer wrote:

> On Wed, Nov 12, 2003 at 05:10:41PM +0000, Angus Leeming spake
> thusly:
> 
> ...
> 
> Progress!
> 
> Now I have the attached, and the dialog comes up and if you enter a
> string there, it becomes the inset name. I.e., the "APPLY: no inset"
> branch now functions. And not only for label, but for URLs as well.
> 
> The "APPLY: we have an inset" branch still fails though.
> 
> Still, this is an improvement. I propose to check this in -- unless
> you have an easy, off-the-cuff proposal to get the MODIFY branch
> going as well...

Well done, Martin! (Don't forget to remove the lyxerr messages before 
you commit the patch ;-)

The alternative fix would be:

        case LFUN_INSET_APPLY: {
                string const name = cmd.getArg(0);
                InsetBase * inset =
                        bv->owner()->getDialogs().getOpenInset(name);

                if (inset) {
                        FuncRequest fr(bv, LFUN_INSET_MODIFY, name);
                        inset->dispatch(fr);
                } else {
                        FuncRequest cmd2 = cmd;
                        cmd2.action = LFUN_INSET_INSERT;
                        dispatch(cmd2);
                }
                break;
        }

        case LFUN_INSET_INSERT:
                doInsertInset(this, cmd, true, false);
                break;

which would enable the outside world to just insert an inset, no 
questions asked.

As for MODIFY... You can see that modification is the responsibility 
of the inset itself. So your search should be redirected at 
InsetLabel and why it is not handling LFUN_INSET_MODIFY.

Regards,
-- 
Angus

Reply via email to