]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLayout.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetLayout.cpp
index a9d3e06fe4a8ec3633d39c2bec2e2674fba140a5..1de4b1cbe29b2a9ad24671c954754a3530fd3ab0 100644 (file)
@@ -59,6 +59,20 @@ enum InsetLayoutTags {
 };
 
 
+namespace {
+       InsetDecoration translateDecoration(std::string const & str) 
+       {
+               if (str == "classic")
+                       return Deco_Classic;
+               if (str == "minimalistic")
+                       return Deco_Minimalistic;
+               if (str == "conglomerate")
+                       return Deco_Conglomerate;
+               return Deco_Default;
+       }
+}
+
+
 bool InsetLayout::read(Lexer & lexrc)
 {
        name_ = support::subst(lexrc.getDocString(), '_', ' ');
@@ -114,7 +128,7 @@ bool InsetLayout::read(Lexer & lexrc)
                        break;
                case IL_DECORATION:
                        lexrc.next();
-                       decoration_ = lexrc.getString();
+                       decoration_ = translateDecoration(lexrc.getString());
                        break;
                case IL_LATEXNAME:
                        lexrc.next();