]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Disallow InsetMarginals in InsetTabulars.
[lyx.git] / src / insets / InsetTabular.cpp
index d75e2a6ffe5e7118150020044bb53d4d52359024..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;
+       }
 }
 
 
@@ -3560,7 +3566,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                //lyxerr << "# InsetTabular::MouseMotion\n" << bvcur << endl;
                if (cmd.button() == mouse_button::button1) {
                        // only accept motions to places not deeper nested than the real anchor
-                       if (!bvcur.anchor_.hasPart(cur)) {
+                       if (!bvcur.realAnchor().hasPart(cur)) {
                                cur.undispatched();
                                break;
                        }
@@ -3590,7 +3596,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                        }
                        // only update if selection changes
                        if (bvcur.idx() == cur.idx() &&
-                               !(bvcur.anchor_.idx() == cur.idx() && bvcur.pos() != cur.pos()))
+                               !(bvcur.realAnchor().idx() == cur.idx() && bvcur.pos() != cur.pos()))
                                cur.noUpdate();
                        setCursorFromCoordinates(cur, cmd.x(), cmd.y());
                        bvcur.setCursor(cur);
@@ -4001,7 +4007,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
                }
                if (action == Tabular::LAST_ACTION) {
                        status.clear();
-                       status.unknown(true);
+                       status.setUnknown(true);
                        return true;
                }