- if (layout_.decoration == "classic")
- return Classic;
- if (layout_.decoration == "minimalistic")
- return Minimalistic;
- if (layout_.decoration == "conglomerate")
- return Conglomerate;
- if (name() == from_ascii("Flex"))
- return Conglomerate;
- return Classic;
+ if (!layout_)
+ return Deco_Classic;
+ InsetDecoration const dec = layout_->decoration();
+ switch (dec) {
+ case Deco_Classic:
+ case Deco_Minimalistic:
+ case Deco_Conglomerate:
+ return dec;
+ case Deco_Default:
+ break;
+ }
+ if (lyxCode() == FLEX_CODE)
+ // FIXME: Is this really necessary?
+ return Deco_Conglomerate;
+ return Deco_Classic;
+}
+
+
+bool InsetCollapsable::isMacroScope(Buffer const &) const
+{
+ // layout_ == 0 leads to no latex output, so ignore
+ // the macros outside
+ if (!layout_)
+ return true;
+
+ // see InsetCollapsable::latex(...) below. In these case
+ // an environment is opened there
+ if (!layout_->latexname().empty())
+ return true;
+
+ return false;