]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.C
remove unused code
[lyx.git] / src / lyxlayout.C
index 130c12803953e50a632c6b5a90679c6ffb900c15..969e0ba53899c96bd36669ccbbb53cf559869886 100644 (file)
@@ -32,6 +32,7 @@ enum LayoutTags {
        LT_MARGIN,
        LT_BOTTOMSEP,
        LT_COPYSTYLE,
+       LT_DEPENDSON,
        LT_OBSOLETEDBY,
        //LT_EMPTY,
        LT_END,
@@ -114,45 +115,46 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
 {
        // This table is sorted alphabetically [asierra 30March96]
        keyword_item layoutTags[] = {
-               { "align",                      LT_ALIGN },
-               { "alignpossible",              LT_ALIGNPOSSIBLE },
-               { "bottomsep",                  LT_BOTTOMSEP },
-               { "copystyle",                  LT_COPYSTYLE },
-               { "end",                        LT_END },
+               { "align",              LT_ALIGN },
+               { "alignpossible",      LT_ALIGNPOSSIBLE },
+               { "bottomsep",          LT_BOTTOMSEP },
+               { "copystyle",          LT_COPYSTYLE },
+               { "dependson",          LT_DEPENDSON },
+               { "end",                LT_END },
                { "endlabelstring",     LT_ENDLABELSTRING },
                { "endlabeltype",       LT_ENDLABELTYPE },
-               { "fill_bottom",                LT_FILL_BOTTOM },
-               { "fill_top",                   LT_FILL_TOP },
-               { "font",       LT_FONT },
-               { "freespacing",                LT_FREE_SPACING },
-               { "intitle",                    LT_INTITLE },
-               { "itemsep",    LT_ITEMSEP },
-               { "keepempty",                  LT_KEEPEMPTY },
-               { "labelbottomsep",             LT_LABEL_BOTTOMSEP },
-               { "labelfont",  LT_LABELFONT },
+               { "fill_bottom",        LT_FILL_BOTTOM },
+               { "fill_top",           LT_FILL_TOP },
+               { "font",               LT_FONT },
+               { "freespacing",        LT_FREE_SPACING },
+               { "intitle",            LT_INTITLE },
+               { "itemsep",            LT_ITEMSEP },
+               { "keepempty",          LT_KEEPEMPTY },
+               { "labelbottomsep",     LT_LABEL_BOTTOMSEP },
+               { "labelfont",          LT_LABELFONT },
                { "labelindent",        LT_LABELINDENT },
-               { "labelsep",   LT_LABELSEP },
+               { "labelsep",           LT_LABELSEP },
                { "labelstring",        LT_LABELSTRING },
-               { "labelstringappendix",        LT_LABELSTRING_APPENDIX },
-               { "labeltype",  LT_LABELTYPE },
-               { "latexname",  LT_LATEXNAME },
-               { "latexparam",                 LT_LATEXPARAM },
-               { "latextype",  LT_LATEXTYPE },
-               { "leftmargin", LT_LEFTMARGIN },
-               { "margin",     LT_MARGIN },
-               { "needprotect",                LT_NEED_PROTECT },
-               { "newline",                    LT_NEWLINE },
-               { "nextnoindent",               LT_NEXTNOINDENT },
-               { "obsoletedby",                LT_OBSOLETEDBY },
-               { "parindent",                  LT_PARINDENT },
-               { "parsep",                     LT_PARSEP },
-               { "parskip",                    LT_PARSKIP },
-               { "passthru",                   LT_PASS_THRU },
-               { "preamble",                   LT_PREAMBLE },
-               { "rightmargin",                LT_RIGHTMARGIN },
-               { "spacing",                    LT_SPACING },
-               { "textfont",                   LT_TEXTFONT },
-               { "topsep",                     LT_TOPSEP }
+               { "labelstringappendix", LT_LABELSTRING_APPENDIX },
+               { "labeltype",          LT_LABELTYPE },
+               { "latexname",          LT_LATEXNAME },
+               { "latexparam",         LT_LATEXPARAM },
+               { "latextype",          LT_LATEXTYPE },
+               { "leftmargin",         LT_LEFTMARGIN },
+               { "margin",             LT_MARGIN },
+               { "needprotect",        LT_NEED_PROTECT },
+               { "newline",            LT_NEWLINE },
+               { "nextnoindent",       LT_NEXTNOINDENT },
+               { "obsoletedby",        LT_OBSOLETEDBY },
+               { "parindent",          LT_PARINDENT },
+               { "parsep",             LT_PARSEP },
+               { "parskip",            LT_PARSKIP },
+               { "passthru",           LT_PASS_THRU },
+               { "preamble",           LT_PREAMBLE },
+               { "rightmargin",        LT_RIGHTMARGIN },
+               { "spacing",            LT_SPACING },
+               { "textfont",           LT_TEXTFONT },
+               { "topsep",             LT_TOPSEP }
        };
 
        bool error = false;
@@ -183,15 +185,20 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
 
                                if (tclass.hasLayout(style)) {
                                        string const tmpname = name_;
-                                       this->operator=(tclass[style]);
+                                       this->operator=(*tclass[style]);
                                        name_ = tmpname;
                                } else {
-                                       lyxerr << "Cannot copy unknown style `" << style << "'" << endl;
-                                       LyXTextClass::const_iterator it = tclass.begin();
-                                       LyXTextClass::const_iterator end = tclass.end();
-                                       lyxerr << "All layouts so far:" << endl;
+                                       lyxerr << "Cannot copy unknown style `"
+                                              << style << "'\n"
+                                              << "All layouts so far:"
+                                              << endl;
+                                       LyXTextClass::const_iterator it =
+                                               tclass.begin();
+                                       LyXTextClass::const_iterator end =
+                                               tclass.end();
                                        for (; it != end; ++it) {
-                                               lyxerr << it->name() << endl;
+                                               lyxerr << (*it)->name()
+                                                      << endl;
                                        }
 
                                        //lexrc.printError("Cannot copy known "
@@ -206,7 +213,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
 
                                if (tclass.hasLayout(style)) {
                                        string const tmpname = name_;
-                                       this->operator=(tclass[style]);
+                                       this->operator=(*tclass[style]);
                                        name_ = tmpname;
                                        if (obsoleted_by().empty())
                                                obsoleted_by_ = style;
@@ -220,6 +227,12 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        }
                        break;
 
+               case LT_DEPENDSON: 
+                       if (lexrc.next()) {
+                               depends_on_ = lexrc.getString();
+                       }
+                       break;
+
                case LT_MARGIN:         // Margin style definition.
                        readMargin(lexrc);
                        break;
@@ -749,3 +762,9 @@ string const & LyXLayout::obsoleted_by() const
 {
        return obsoleted_by_;
 }
+
+
+string const & LyXLayout::depends_on() const
+{
+       return depends_on_;
+}