]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.C
Point fix, earlier forgotten
[lyx.git] / src / lyxlayout.C
index 2f815aa162851979c017da2dc9d0b58d699e989b..d1ddac4b741fdea6a89f0438f856e01fe81f4d18 100644 (file)
@@ -1,12 +1,13 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file lyxlayout.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author André Pönitz
  *
- *          Copyright 1995 Matthias Ettrich
- *          Copyright 1995-2001 The LyX Team.
- *
- * ======================================================
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
@@ -18,6 +19,8 @@
 
 #include "support/lstrings.h"
 
+using namespace lyx::support;
+
 using std::endl;
 
 //  The order of the LayoutTags enum is no more important. [asierra300396]
@@ -57,6 +60,9 @@ enum LayoutTags {
        LT_LATEXPARAM,
        LT_OPTARGS,
        LT_LATEXTYPE,
+       LT_LATEXHEADER,
+       LT_LATEXFOOTER,
+       LT_LATEXPARAGRAPH,
        LT_LEFTMARGIN,
        LT_NEED_PROTECT,
        LT_NEWLINE,
@@ -105,6 +111,7 @@ LyXLayout::LyXLayout ()
        newline_allowed = true;
        free_spacing = false;
        pass_thru = false;
+       is_environment = false;
 }
 
 
@@ -135,7 +142,10 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                { "labelstring",        LT_LABELSTRING },
                { "labelstringappendix", LT_LABELSTRING_APPENDIX },
                { "labeltype",          LT_LABELTYPE },
+               { "latexfooter",                LT_LATEXFOOTER },
+               { "latexheader",                LT_LATEXHEADER },
                { "latexname",          LT_LATEXNAME },
+               { "latexparagraph",             LT_LATEXPARAGRAPH },
                { "latexparam",         LT_LATEXPARAM },
                { "latextype",          LT_LATEXTYPE },
                { "leftmargin",         LT_LEFTMARGIN },
@@ -232,14 +242,29 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        }
                        break;
 
-               case LT_MARGIN:         // Margin style definition.
+               case LT_MARGIN:         // margin style definition.
                        readMargin(lexrc);
                        break;
 
-               case LT_LATEXTYPE:      // Latex style definition.
+               case LT_LATEXTYPE:      // LaTeX style definition.
                        readLatexType(lexrc);
                        break;
 
+               case LT_LATEXHEADER:    // header for environments
+                       lexrc.next();
+                       latexheader = lexrc.getString();
+                       break;
+
+               case LT_LATEXFOOTER:    // footer for environments
+                       lexrc.next();
+                       latexfooter = lexrc.getString();
+                       break;
+
+               case LT_LATEXPARAGRAPH:
+                       lexrc.next();
+                       latexparagraph = lexrc.getString();
+                       break;
+
                case LT_INTITLE:
                        intitle = lexrc.next() && lexrc.getInteger();
                        break;
@@ -380,17 +405,17 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
 
                case LT_LABELSTRING:    // label string definition
                        if (lexrc.next())
-                               labelstring_ = lexrc.getString();
+                               labelstring_ = trim(lexrc.getString());
                        break;
 
                case LT_ENDLABELSTRING: // endlabel string definition
                        if (lexrc.next())
-                               endlabelstring_ = lexrc.getString();
+                               endlabelstring_ = trim(lexrc.getString());
                        break;
 
                case LT_LABELSTRING_APPENDIX: // label string appendix definition
                        if (lexrc.next())
-                               labelstring_appendix_ = lexrc.getString();
+                               labelstring_appendix_ = trim(lexrc.getString());
                        break;
 
                case LT_FREE_SPACING:   // Allow for free spacing.