Martin Vermeer wrote:
On Wed, Oct 31, 2007 at 10:28:04PM +0200, Martin Vermeer wrote:
On Wed, Oct 31, 2007 at 07:53:22PM +0100, Andre Poenitz wrote:
On Wed, Oct 31, 2007 at 06:24:22PM +0200, Martin Vermeer wrote:
 // Read a font definition from given file in lyx format
 // Used for layouts
-FontInfo lyxRead(Lexer & lex)
+FontInfo lyxRead(Lexer & lex, FontInfo f)
Should be  FontInfo const &.

Andre'
Yes, here is a better patch (with now also needprotect implemented)

I just notice that the NeedProtect parameter is poorly named. What it
signals is this environment _has a moving argument_. It does not signal
that this command (inset?) needs protection because _it is fragile_.
Proper usage like illustrated below.

Ideally we would need two parameters, and better named ones at that:
HasMovingArg and IsFragile. Currently we have only the first, meaning
\protect gets output way too often. Not disastrous, but at least the
naming could be better.
Yes, this issue came up a while ago when I was trying to work on the "alignment in tables" bugs.

Richard
- Martin

Index: InsetCollapsable.cpp
===================================================================
--- InsetCollapsable.cpp        (revision 21308)
+++ InsetCollapsable.cpp        (working copy)
@@ -797,6 +797,8 @@
        if (!layout_.latexname.empty()) {
                if (layout_.latextype == "command") {
                        // FIXME UNICODE
+                       if (runparams.moving_arg)
+                               os << "\\protect";
                        os << '\\' << from_utf8(layout_.latexname);
                        if (!layout_.latexparam.empty())
                                os << from_utf8(layout_.latexparam);
@@ -810,6 +812,8 @@
        OutputParams rp = runparams;
        if (layout_.passthru)
                rp.verbatim = true;
+       if (layout_.needprotect)
+               rp.moving_arg = true;
        int i = InsetText::latex(buf, os, rp);
        if (!layout_.latexname.empty()) {
                if (layout_.latextype == "command") {


--
==================================================================
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