diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 00d9a6f20f..536f4bd163 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -1838,29 +1838,4 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd, } -// static -char InsetMathGrid::colAlign(HullType type, col_type col) -{ - switch (type) { - case hullEqnArray: - return "rcl"[col % 3]; - - case hullMultline: - case hullGather: - return 'c'; - - case hullAlign: - case hullAlignAt: - case hullXAlignAt: - case hullXXAlignAt: - case hullFlAlign: - return "rl"[col & 1]; - - default: - return 'c'; - } -} - - - } // namespace lyx diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index 6199b7dafc..bd3066db0b 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -258,11 +258,10 @@ protected: virtual docstring eocString(col_type col, col_type lastcol) const; /// splits cells and shifts right part to the next cell void splitCell(Cursor & cur); - /// Column alignment for display of cell \p idx. + /// Column aligmment for display of cell \p idx. /// Must not be written to file! virtual char displayColAlign(idx_type idx) const; - /// The value of a fixed col align for a certain hull type - static char colAlign(HullType type, col_type col); + /// row info. /// rowinfo_[nrows()] is a dummy row used only for hlines. diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index cce029f6ce..097a3445c5 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -349,34 +349,28 @@ bool InsetMathHull::idxLast(Cursor & cur) const } -//FIXME: This has probably no effect and can be removed. char InsetMathHull::defaultColAlign(col_type col) { - return colAlign(type_, col); + if (type_ == hullEqnArray) + return "rcl"[col]; + if (type_ == hullMultline) + return 'c'; + if (type_ == hullGather) + return 'c'; + if (type_ >= hullAlign) + return "rl"[col & 1]; + return 'c'; } char InsetMathHull::displayColAlign(idx_type idx) const { - switch (type_) { - case hullMultline: { + if (type_ == hullMultline) { row_type const r = row(idx); if (r == 0) return 'l'; if (r == nrows() - 1) return 'r'; - return 'c'; - } - case hullEqnArray: - case hullGather: - case hullAlign: - case hullAlignAt: - case hullXAlignAt: - case hullXXAlignAt: - case hullFlAlign: - return colAlign(type_, col(idx)); - default: - break; } return InsetMathGrid::displayColAlign(idx); } @@ -1247,27 +1241,6 @@ void InsetMathHull::setType(HullType type) } -bool InsetMathHull::isMutable(HullType type) -{ - switch (type) { - case hullNone: - case hullSimple: - case hullEquation: - case hullEqnArray: - case hullAlign: - case hullFlAlign: - case hullAlignAt: - case hullXAlignAt: - case hullXXAlignAt: - case hullMultline: - case hullGather: - return true; - default: - return false; - } -} - - void InsetMathHull::mutate(HullType newtype) { //lyxerr << "mutating from '" << type_ << "' to '" << newtype << "'" << endl; diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp index f85e664eef..5c425fb002 100644 --- a/src/mathed/InsetMathSplit.cpp +++ b/src/mathed/InsetMathSplit.cpp @@ -48,41 +48,20 @@ Inset * InsetMathSplit::clone() const } -//FIXME: This has probably no effect and can be removed. char InsetMathSplit::defaultColAlign(col_type col) { + if (name_ == "split") + return 'l'; if (name_ == "gathered") return 'c'; - if (name_ == "lgathered") - return 'l'; - if (name_ == "rgathered") - return 'r'; - if (name_ == "split" - || name_ == "aligned" - || name_ == "align" - || name_ == "alignedat") - return colAlign(hullAlign, col); + if (name_ == "aligned" || name_ == "align") + return (col & 1) ? 'l' : 'r'; + if (name_ == "alignedat") + return (col & 1) ? 'l' : 'r'; return 'l'; } -char InsetMathSplit::displayColAlign(idx_type idx) const -{ - if (name_ == "gathered") - return 'c'; - if (name_ == "lgathered") - return 'l'; - if (name_ == "rgathered") - return 'r'; - if (name_ == "split" - || name_ == "aligned" - || name_ == "align" - || name_ == "alignedat") - return colAlign(hullAlign, col(idx)); - return InsetMathGrid::displayColAlign(idx); -} - - void InsetMathSplit::draw(PainterInfo & pi, int x, int y) const { InsetMathGrid::draw(pi, x, y); @@ -107,10 +86,6 @@ bool InsetMathSplit::getStatus(Cursor & cur, FuncRequest const & cmd, flag.setEnabled(false); return true; } - if (s == "align-left" || s == "align-center" || s == "align-right") { - flag.setEnabled(false); - return true; - } break; } default: diff --git a/src/mathed/InsetMathSplit.h b/src/mathed/InsetMathSplit.h index 6136b6faf6..b0ff437f3d 100644 --- a/src/mathed/InsetMathSplit.h +++ b/src/mathed/InsetMathSplit.h @@ -43,8 +43,6 @@ public: /// char defaultColAlign(col_type); /// - char displayColAlign(idx_type idx) const; - /// InsetCode lyxCode() const { return MATH_SPLIT_CODE; } private: