]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.C
Restore the version number position on the splash screen
[lyx.git] / src / lyxlayout.C
index 1e77971b8765c237b1e54f899a8e0e81d028a4e3..b5f7223c6e48aaec86550fb5fdaff44f0f7ade29 100644 (file)
 
 #include "support/lstrings.h"
 
-using lyx::support::subst;
-using lyx::support::trim;
+
+namespace lyx {
+
+using support::subst;
+using support::trim;
 
 using std::endl;
 using std::string;
@@ -129,7 +132,7 @@ LyXLayout::LyXLayout ()
 
 
 // Reads a layout definition from file
-bool LyXLayout::Read(LyXLex & lexrc, LyXTextClass const & tclass)
+bool LyXLayout::read(LyXLex & lexrc, LyXTextClass const & tclass)
 {
        // This table is sorted alphabetically [asierra 30March96]
        keyword_item layoutTags[] = {
@@ -357,7 +360,7 @@ bool LyXLayout::Read(LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_PREAMBLE:
-                       preamble_ = lexrc.getLongString("EndPreamble");
+                       preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
                        break;
 
                case LT_LABELTYPE:
@@ -447,23 +450,25 @@ bool LyXLayout::Read(LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_LABELSTRING:    // label string definition
-                       if (lexrc.next())
-                               labelstring_ = trim(lexrc.getString());
+                       if (lexrc.next()) {
+                               labelstring_ = trim(lexrc.getDocString());
+                               labelstring_appendix_ = labelstring_;
+                       }
                        break;
 
                case LT_ENDLABELSTRING: // endlabel string definition
                        if (lexrc.next())
-                               endlabelstring_ = trim(lexrc.getString());
+                               endlabelstring_ = trim(lexrc.getDocString());
                        break;
 
                case LT_LABELSTRING_APPENDIX: // label string appendix definition
                        if (lexrc.next())
-                               labelstring_appendix_ = trim(lexrc.getString());
+                               labelstring_appendix_ = trim(lexrc.getDocString());
                        break;
 
                case LT_LABELCOUNTER: // name of counter to use
                        if (lexrc.next())
-                               counter = trim(lexrc.getString());
+                               counter = lyx::from_ascii(trim(lexrc.getString()));
                        break;
 
                case LT_FREE_SPACING:   // Allow for free spacing.
@@ -483,8 +488,6 @@ bool LyXLayout::Read(LyXLex & lexrc, LyXTextClass const & tclass)
        }
        lexrc.popTable();
 
-       if (labelstring_appendix_.empty())
-               labelstring_appendix_ = labelstring_;
        return error;
 }
 
@@ -816,3 +819,6 @@ string const & LyXLayout::depends_on() const
 {
        return depends_on_;
 }
+
+
+} // namespace lyx