]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.C
Move #includes out of header files.
[lyx.git] / src / lyxlayout.C
index a0bdb5ed2e2a602d3cde8907d3547e8481e27b26..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]
@@ -59,6 +62,7 @@ enum LayoutTags {
        LT_LATEXTYPE,
        LT_LATEXHEADER,
        LT_LATEXFOOTER,
+       LT_LATEXPARAGRAPH,
        LT_LEFTMARGIN,
        LT_NEED_PROTECT,
        LT_NEWLINE,
@@ -107,6 +111,7 @@ LyXLayout::LyXLayout ()
        newline_allowed = true;
        free_spacing = false;
        pass_thru = false;
+       is_environment = false;
 }
 
 
@@ -140,6 +145,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                { "latexfooter",                LT_LATEXFOOTER },
                { "latexheader",                LT_LATEXHEADER },
                { "latexname",          LT_LATEXNAME },
+               { "latexparagraph",             LT_LATEXPARAGRAPH },
                { "latexparam",         LT_LATEXPARAM },
                { "latextype",          LT_LATEXTYPE },
                { "leftmargin",         LT_LEFTMARGIN },
@@ -236,24 +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:    // Latex style definition.
+               case LT_LATEXHEADER:    // header for environments
                        lexrc.next();
                        latexheader = lexrc.getString();
                        break;
 
-               case LT_LATEXFOOTER:    // Latex style definition.
+               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;
@@ -394,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.