using namespace std;
using namespace lyx::support;
-using boost::shared_ptr;
namespace lyx {
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;
+ }
}
//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;
}
}
// 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);
}
if (action == Tabular::LAST_ACTION) {
status.clear();
- status.unknown(true);
+ status.setUnknown(true);
return true;
}