]> git.lyx.org Git - features.git/commitdiff
Make Richard happy, add inset layout parm 'Decoration'
authorMartin Vermeer <martin.vermeer@hut.fi>
Sat, 25 Aug 2007 09:57:32 +0000 (09:57 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Sat, 25 Aug 2007 09:57:32 +0000 (09:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19786 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextClass.cpp
src/TextClass.h
src/insets/InsetCharStyle.cpp
src/insets/InsetCharStyle.h

index 4cd7599116e0fed62fb23f703a3e460fc8a06a8d..942c360c7fcfb3b2cdbbfd8bd5e9f23a526c7d30 100644 (file)
@@ -598,6 +598,7 @@ void TextClass::readClassOptions(Lexer & lexrc)
 
 enum InsetLayoutTags {
        IL_FONT = 1,
+       IL_DECORATION,
        IL_LABELFONT,
        IL_LABELSTRING,
        IL_LATEXNAME,
@@ -612,6 +613,7 @@ enum InsetLayoutTags {
 void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
 {
        keyword_item elementTags[] = {
+               { "decoration", IL_DECORATION },
                { "end", IL_END },
                { "font", IL_FONT },
                { "labelfont", IL_LABELFONT },
@@ -628,6 +630,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
        string lyxtype;
        docstring labelstring;
        string latextype;
+       string decoration;
        string latexname;
        string latexparam;
        Font font(Font::ALL_INHERIT);
@@ -656,6 +659,10 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                        lexrc.next();
                        labelstring = lexrc.getDocString();
                        break;
+               case IL_DECORATION:
+                       lexrc.next();
+                       decoration = lexrc.getString();
+                       break;
                case IL_LATEXNAME:
                        lexrc.next();
                        latexname = lexrc.getString();
@@ -689,6 +696,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                il.name = to_ascii(name);
                il.lyxtype = lyxtype;
                il.labelstring = labelstring;
+               il.decoration = decoration;
                il.latextype = latextype;
                il.latexname = latexname;
                il.latexparam = latexparam;
index 3de96d752da2b55b0a394fdba42d3ea083f58073..ad2d28f7ac5c3dc8263d6e9509ba6dd4d3a57a38 100644 (file)
@@ -34,6 +34,7 @@ public:
        std::string name;
        std::string lyxtype;
        docstring labelstring;
+       std::string decoration;
        std::string latextype;
        std::string latexname;
        std::string latexparam;
index 042cec2b8f0a61bf44e78f69e8eb16b1ecaf8b29..d967957e7a9f3a0e1284cc82d124463f8e801ef2 100644 (file)
@@ -203,6 +203,18 @@ bool InsetCharStyle::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
+InsetCollapsable::Decoration InsetCharStyle::decoration() const
+{
+       if (layout_.decoration == "classic")
+               return Classic;
+       if (layout_.decoration == "minimalistic")
+               return Minimalistic;
+       if (layout_.decoration == "conglomerate")
+               return Conglomerate;
+       return Conglomerate;
+}
+
+
 int InsetCharStyle::plaintext(Buffer const & buf, odocstream & os,
                              OutputParams const & runparams) const
 {
index cb491bc986e6b68b94a9a96c854e1aebcd3937e7..b63dfda8f69eaa3385a4a35418200284a8641200 100644 (file)
@@ -66,7 +66,7 @@ public:
        ///
        bool forceDefaultParagraphs(idx_type) const { return true; }
        ///
-       virtual Decoration decoration() const { return Conglomerate; }
+       virtual Decoration decoration() const;
 
        ///
        int plaintext(Buffer const &, odocstream &,