]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathGrid.cpp
Be careful before using buffer parameters in colAlign
[features.git] / src / mathed / InsetMathGrid.cpp
index 910450d378643290046df936192080fb7ca9d270..34fb53dcee471524809aae86064afcde71600ba8 100644 (file)
@@ -1831,8 +1831,7 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-// static
-char InsetMathGrid::colAlign(HullType type, col_type col, BufferParams const & bp)
+char InsetMathGrid::colAlign(HullType type, col_type col) const
 {
        switch (type) {
        case hullEqnArray:
@@ -1841,10 +1840,13 @@ char InsetMathGrid::colAlign(HullType type, col_type col, BufferParams const & b
        case hullMultline:
                return 'c';
        case hullGather:
-               if (!bp.is_math_indent)
-                       return 'c';
-               else
+               LASSERT(isBufferValid(),
+                               LYXERR0("Buffer not set correctly. Please report!");
+                               return 'c';);
+               if (buffer().params().is_math_indent)
                        return 'l';
+               else
+                       return 'c';
 
        case hullAlign:
        case hullAlignAt: