Uwe Stöhr wrote:
- This entry in InsertUrl.cpp
InsetUrl::InsetUrl(InsetCommandParams const & p)
    : InsetCommand(p, "url")
{}
leads to a crash in InsetCommandparams.cpp line 46. Because when the user uses the hyperlink checkbox in the URL-dialog, the inset Type has changed - what is correct and wanted.
Yes, I see the crash, but it's not for that reason. It's not the inset type that changes, just the command the inset is issuing. It's the call
void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
{
   switch (cmd.action) {
...
   case LFUN_INSET_MODIFY: {
       InsetCommandParams p(p_.getCmdName());
that is wrong. This kind of thing will be caught better later, when InsetCommandParams takes an Inset::Code rather than a string. I'll fix it now, though. The call should be:
       InsetCommandParams p(p_.getInsetType());
Later, too, it'll be possible to do something like this:
   InsetCommandParams p(insetType, commandName);
in case you have different parameters depending upon the command the inset represents.
- InsetCommandParams.cpp line 321:

if (!insetType_.empty() && insetType != insetType_) {
lex.printError("InsetCommand: Attempt to change type of parameters.");

This check prevents insets from beeing switched. But this is currently done in the URL dialog and will also in future be. We furthermore need to change insets when e.g. the wrap floats are merged with the other floats. So this check needn't to be there.
We'll have to look at this more closely, but I expect it's the same as with the previous case. What we want to prevent is the type of inset from being changed, not the command or for that matter the accepted parameters. (All of this is supposed to make things more flexible than they were before, not less.)
- When I e.g. create an "href" inset and add entries for it to getDefaultCmd and findInfo, href insets can't be opened in LyX.
Send the patch, and let's see what the problem is. Very little has actually changed here.

Richard

--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to