}
+bool InsetMathHull::isTable() const
+{
+ switch (type_) {
+ case hullEqnArray:
+ case hullAlign:
+ case hullAlignAt:
+ case hullXAlignAt:
+ case hullXXAlignAt:
+ case hullFlAlign:
+ case hullMultline:
+ case hullGather:
+ return true;
+ case hullNone:
+ case hullSimple:
+ case hullEquation:
+ case hullRegexp:
+ break;
+ }
+ return false;
+}
+
+
bool InsetMathHull::rowChangeOK() const
{
return
break;
}
+ case LFUN_TABULAR_FEATURE:
+ if (!isTable())
+ cur.undispatched();
+ else
+ InsetMathGrid::doDispatch(cur, cmd);
+ break;
+
default:
InsetMathGrid::doDispatch(cur, cmd);
break;
return InsetMathGrid::getStatus(cur, cmd, status);
case LFUN_TABULAR_FEATURE: {
+ if (!isTable())
+ return false;
string s = cmd.getArg(0);
if (!rowChangeOK()
&& (s == "append-row"
status.setEnabled(false);
return true;
}
- if ((type_ == hullSimple
- || type_ == hullEquation
- || type_ == hullNone) &&
- (s == "add-hline-above" || s == "add-hline-below")) {
- status.message(bformat(
- from_utf8(N_("Can't add horizontal grid lines in '%1$s'")),
- hullName(type_)));
- status.setEnabled(false);
- return true;
- }
if (s == "add-vline-left" || s == "add-vline-right") {
status.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
ColorCode standardColor() const;
/// consistency check
void check() const;
+ /// does it understand tabular-feature commands?
+ bool isTable() const;
/// can this change its number of rows?
bool rowChangeOK() const;
/// can this change its number of cols?