]> git.lyx.org Git - features.git/commitdiff
Revert "Revert "Fix the display of column spacing in AMS environments""
authorUwe Stöhr <uwestoehr@lyx.org>
Tue, 19 Jan 2016 22:20:53 +0000 (23:20 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Tue, 19 Jan 2016 22:20:53 +0000 (23:20 +0100)
This reverts commit f1a388584fb2c043d17127d7db49c36cb8427cfa.

# Conflicts:
# src/mathed/InsetMathGrid.cpp
# src/mathed/InsetMathSplit.cpp

src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathSplit.cpp
src/mathed/InsetMathSplit.h

index 00d9a6f20fbf2b2369a976d01edf49a00ef1b9a6..536f4bd163a671347d7a15150f7da6c407a1d4bb 100644 (file)
@@ -1838,29 +1838,4 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-// static\r
-char InsetMathGrid::colAlign(HullType type, col_type col)\r
-{\r
-       switch (type) {\r
-       case hullEqnArray:\r
-               return "rcl"[col % 3];\r
-\r
-       case hullMultline:\r
-       case hullGather:\r
-               return 'c';\r
-\r
-       case hullAlign:\r
-       case hullAlignAt:\r
-       case hullXAlignAt:\r
-       case hullXXAlignAt:\r
-       case hullFlAlign:\r
-               return "rl"[col & 1];\r
-\r
-       default:\r
-               return 'c';\r
-       }\r
-}\r
-\r
-\r
-\r
 } // namespace lyx
index 6199b7dafc8fef516acaa7934f8e8298dab0ce79..bd3066db0b2e85b662925eff3c00af65d6987ab3 100644 (file)
@@ -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.\r
+       /// 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 \r
-       static char colAlign(HullType type, col_type col);\r
+
 
        /// row info.
        /// rowinfo_[nrows()] is a dummy row used only for hlines.
index cce029f6cedf25f98b3f3293ac45ea8cb8476974..097a3445c5f5196b6ba65ecd06de5716d2efeee6 100644 (file)
@@ -349,34 +349,28 @@ bool InsetMathHull::idxLast(Cursor & cur) const
 }
 
 
-//FIXME: This has probably no effect and can be removed.\r
 char InsetMathHull::defaultColAlign(col_type col)
 {
-       return colAlign(type_, col);\r
+       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_) {\r
-       case hullMultline: {\r
+       if (type_ == hullMultline) {
                row_type const r = row(idx);
                if (r == 0)
                        return 'l';
                if (r == nrows() - 1)
                        return 'r';
-               return 'c';\r
-       }\r
-       case hullEqnArray:\r
-       case hullGather:\r
-       case hullAlign:\r
-       case hullAlignAt:\r
-       case hullXAlignAt:\r
-       case hullXXAlignAt:\r
-       case hullFlAlign:\r
-               return colAlign(type_, col(idx));\r
-       default:\r
-               break;\r
        }
        return InsetMathGrid::displayColAlign(idx);
 }
@@ -1247,27 +1241,6 @@ void InsetMathHull::setType(HullType type)
 }
 
 
-bool InsetMathHull::isMutable(HullType type)\r
-{\r
-       switch (type) {\r
-       case hullNone:\r
-       case hullSimple:\r
-       case hullEquation:\r
-       case hullEqnArray:\r
-       case hullAlign:\r
-       case hullFlAlign:\r
-       case hullAlignAt:\r
-       case hullXAlignAt:\r
-       case hullXXAlignAt:\r
-       case hullMultline:\r
-       case hullGather:\r
-               return true;\r
-       default:\r
-               return false;\r
-       }\r
-}\r
-\r
-\r
 void InsetMathHull::mutate(HullType newtype)
 {
        //lyxerr << "mutating from '" << type_ << "' to '" << newtype << "'" << endl;
index f85e664eefee0647053320b9329cb4c7cf387fe9..5c425fb00297dc03ee448daa03442a777532b15a 100644 (file)
@@ -48,41 +48,20 @@ Inset * InsetMathSplit::clone() const
 }
 
 
-//FIXME: This has probably no effect and can be removed.\r
 char InsetMathSplit::defaultColAlign(col_type col)
 {
+       if (name_ == "split")
+               return 'l';
        if (name_ == "gathered")
                return 'c';
-       if (name_ == "lgathered")\r
-               return 'l';\r
-       if (name_ == "rgathered")\r
-               return 'r';\r
-       if (name_ == "split"\r
-           || name_ == "aligned"\r
-           || name_ == "align"\r
-           || name_ == "alignedat")\r
-               return colAlign(hullAlign, col);\r
+       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\r
-{\r
-       if (name_ == "gathered")\r
-               return 'c';\r
-       if (name_ == "lgathered")\r
-               return 'l';\r
-       if (name_ == "rgathered")\r
-               return 'r';\r
-       if (name_ == "split"\r
-           || name_ == "aligned"\r
-           || name_ == "align"\r
-           || name_ == "alignedat")\r
-               return colAlign(hullAlign, col(idx));\r
-       return InsetMathGrid::displayColAlign(idx);\r
-}\r
-\r
-\r
 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") {\r
-                       flag.setEnabled(false);\r
-                       return true;\r
-               }\r
                break;
        }
        default:
index 6136b6faf6806aeb62f7020ed3d098d232018afc..b0ff437f3ddcc5a2920f24f718024eca9062447a 100644 (file)
@@ -43,8 +43,6 @@ public:
        ///
        char defaultColAlign(col_type);
        ///
-       char displayColAlign(idx_type idx) const;\r
-       ///\r
        InsetCode lyxCode() const { return MATH_SPLIT_CODE; }
 
 private: