On Thu, Aug 22, 2002 at 11:58:19AM +0200, Juergen Vigna wrote: > Martin Vermeer wrote: > >>I think this could be fixed for now quite easily. We just have to > >>draw OptInset as the first thing in LyXText (so WYSISYG is always > >>given!), > > > > Not easy IMHO. > > It is believe me ;)
Prove it :->
> > PS just tried it. It isn't so hard. I have in insetoptarg.C:
> > + // Put Optional Argument inset always at start:
> > + InsetOptArg * ioa = optArgInset(*this);
> > + if (layout()->optionalargs == 1) {
> > + if (ioa != 0)
> > + ioa->write(buf, os);
> > + }
> Couldn't we have more than one optional Arg (Inset) in a paragraph?
Hmmm, I cannot come up with any practical use for this. LaTeX has only one
optional argument in addition to any number of {} args.
> And then we should always write the information and not make the write
> depend on the layout type, that will give bad surprises (code vanishing
> between save/reload!)
>
> > + // Suppress writing opt arg in middle:
> > + if (inset != ioa) {
> > + os << "\n\\begin_inset ";
> > + inset->write(buf, os);
> > + os << "\n\\end_inset \n\n";
> > + column = 0;
> > + }
>
> Same as above if we have more than one OptInset then this code is
> wrong.
Well yes. Same words.
Actually I don't like this either. Too much extra handling all over the
place. So I say: restrict the LFUN to insert only in position 0 of the
paragraph, in a 'legal' paragraph for inserting an optional arg. That could
be done in BufferView_pimpl.C, or more cleanly using the getStatus
mechanism (Jean-Marc?)
> Greets,
>
> J�rgen
>
Martin
msg43385/pgp00000.pgp
Description: PGP signature
