]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLayout.cpp
Routines for calculating numerical labels for BibTeX citations.
[lyx.git] / src / insets / InsetLayout.cpp
index 41180c4a0cc356ad13baab91c8cbe4e70cdbba03..0b9963a0ee479ca9cfa26ac18c0f25af682c58ec 100644 (file)
@@ -31,8 +31,8 @@ namespace lyx {
 
 InsetLayout::InsetLayout() :
        name_(from_ascii("undefined")), lyxtype_(STANDARD),
-       labelstring_(from_ascii("UNDEFINED")), decoration_(DEFAULT),
-       latextype_(NOLATEXTYPE), font_(sane_font), 
+       labelstring_(from_ascii("UNDEFINED")), contentaslabel_(false),
+       decoration_(DEFAULT), latextype_(NOLATEXTYPE), font_(sane_font), 
        labelfont_(sane_font), bgcolor_(Color_error), 
        htmlforcecss_ (false), htmlisblock_(true),
        multipar_(true), custompars_(true), forceplain_(false), 
@@ -74,6 +74,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
 {
        enum {
                IL_BGCOLOR,
+               IL_CONTENTASLABEL,
                IL_COPYSTYLE,
                IL_COUNTER,
                IL_CUSTOMPARS,
@@ -110,6 +111,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
 
        LexerKeyword elementTags[] = {
                { "bgcolor", IL_BGCOLOR },
+               { "contentaslabel", IL_CONTENTASLABEL },
                { "copystyle", IL_COPYSTYLE }, 
                { "counter", IL_COUNTER},
                { "custompars", IL_CUSTOMPARS },
@@ -240,6 +242,9 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
                case IL_NEEDPROTECT:
                        lex >> needprotect_;
                        break;
+               case IL_CONTENTASLABEL:
+                       lex >> contentaslabel_;
+                       break;
                case IL_COPYSTYLE: {     // initialize with a known style
                        docstring style;
                        lex >> style;
@@ -354,7 +359,7 @@ InsetLayout::InsetLyXType translateLyXType(std::string const & str)
 string const & InsetLayout::htmltag() const
 {
        if (htmltag_.empty())
-               htmltag_ = "span";
+               htmltag_ = multipar_ ? "div" : "span";
        return htmltag_; 
 }