]> git.lyx.org Git - features.git/commitdiff
one less explicit test against FLEX_CODE
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 13 Jul 2009 14:06:05 +0000 (14:06 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 13 Jul 2009 14:06:05 +0000 (14:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30543 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCollapsable.cpp
src/insets/InsetFlex.cpp
src/insets/InsetFlex.h

index 28c941c55a4e97971a08160c7871dbae5f535e52..930c171df71e456f13e64577b1c957a17049d830 100644 (file)
@@ -875,17 +875,7 @@ docstring InsetCollapsable::floatName(string const & type) const
 InsetLayout::InsetDecoration InsetCollapsable::decoration() const
 {
        InsetLayout::InsetDecoration const dec = getLayout().decoration();
-       switch (dec) {
-       case InsetLayout::CLASSIC:
-       case InsetLayout::MINIMALISTIC:
-       case InsetLayout::CONGLOMERATE:
-               return dec;
-       case InsetLayout::DEFAULT:
-               break;
-       }
-       if (lyxCode() == FLEX_CODE)
-               return InsetLayout::CONGLOMERATE;
-       return InsetLayout::CLASSIC;
+       return dec == InsetLayout::DEFAULT ? InsetLayout::CLASSIC : dec;
 }
 
 
index aaf71aa90d14b6e1d2a5c6bc8c0ed657e31d6d2c..80c755bc28b1dee98c05157212b9fe70c20f6dd9 100644 (file)
@@ -41,6 +41,13 @@ InsetFlex::InsetFlex(InsetFlex const & in)
 {}
 
 
+InsetLayout::InsetDecoration InsetFlex::decoration() const
+{
+       InsetLayout::InsetDecoration const dec = getLayout().decoration();
+       return dec == InsetLayout::DEFAULT ? InsetLayout::CONGLOMERATE : dec;
+}
+
+
 docstring InsetFlex::editMessage() const
 {
        return _("Opened Flex Inset");
index 239ced831fe62fd0148b4f8cd0d42730d50a91ca..9e2ed16f741608a8f106a97b9db99654fc980b02 100644 (file)
@@ -30,6 +30,8 @@ public:
        docstring editMessage() const;
        ///
        InsetCode lyxCode() const { return FLEX_CODE; }
+       /// Default looks
+       InsetLayout::InsetDecoration decoration() const;
        ///
        void write(std::ostream &) const;
        /// should paragraph indendation be ommitted in any case?