]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.cpp
Kill indexing into the list of layouts.
[lyx.git] / src / Layout.cpp
index 7fedb3209c11fc16da9b7edc43a6c3d4626958e2..134d6a1ad96af1ca9524d0aaf689b5617d0e34a4 100644 (file)
@@ -37,6 +37,7 @@ enum LayoutTags {
        LT_ALIGNPOSSIBLE,
        LT_MARGIN,
        LT_BOTTOMSEP,
+       LT_CATEGORY,
        LT_COMMANDDEPTH,
        LT_COPYSTYLE,
        LT_DEPENDSON,
@@ -137,6 +138,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                { "align",          LT_ALIGN },
                { "alignpossible",  LT_ALIGNPOSSIBLE },
                { "bottomsep",      LT_BOTTOMSEP },
+               { "category",       LT_CATEGORY },
                { "commanddepth",   LT_COMMANDDEPTH },
                { "copystyle",      LT_COPYSTYLE },
                { "dependson",      LT_DEPENDSON },
@@ -209,6 +211,11 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                        finished = true;
                        break;
 
+               case LT_CATEGORY:
+                       if (lexrc.next())
+                               category_ = lexrc.getDocString();
+                       break;
+
                case LT_COPYSTYLE:     // initialize with a known style
                        if (lexrc.next()) {
                                docstring const style = subst(lexrc.getDocString(),
@@ -223,9 +230,10 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                                               << to_utf8(style) << "'\n"
                                               << "All layouts so far:"
                                               << endl;
-                                       for (size_t i = 0; i != tclass.layoutCount(); ++i)
-                                               lyxerr << to_utf8(tclass.layout(i)->name())
-                                                      << endl;
+                                       DocumentClass::const_iterator lit = tclass.begin();
+                                       DocumentClass::const_iterator len = tclass.end();
+                                       for (; lit != len; ++lit)
+                                               lyxerr << to_utf8((*lit)->name()) << endl;
 
                                        //lexrc.printError("Cannot copy known "
                                        //               "style `$$Token'");