]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Disallow InsetMarginals in InsetTabulars.
[lyx.git] / src / insets / InsetTabular.cpp
index ad0d6f37b162ecd0d17ccc36b2b122d5893d4814..f17275ddc3c140862ec574eca193504d8b0b6688 100644 (file)
@@ -70,7 +70,6 @@
 using namespace std;
 using namespace lyx::support;
 
-using boost::shared_ptr;
 
 
 namespace lyx {
@@ -3132,11 +3131,18 @@ void InsetTabular::setBuffer(Buffer & buf)
 
 bool InsetTabular::insetAllowed(InsetCode code) const
 {
-       if (code == MATHMACRO_CODE
-               || (code == CAPTION_CODE && !tabular.is_long_tabular))
+       switch (code)
+       {
+       case MARGIN_CODE:
+       case MATHMACRO_CODE:
                return false;
 
-       return true;
+       case CAPTION_CODE:
+               return tabular.is_long_tabular;
+
+       default:
+               return true;
+       }
 }