]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.C
John's Layout Tabular UI improvements and Martins fixes to clearing the
[lyx.git] / src / tabular.C
index 80dfcbcfc04b589055a05c8d9f9abcaded7356a8..85adc025e617e93bc7f6985cf102bb1bb1c64838 100644 (file)
@@ -301,11 +301,13 @@ void LyXTabular::AppendColumn(int cell)
                        c_info[i][j] = cell_info[i][j - 1];
                }
                // care about multicolumns
-               if (c_info[i][column + 1].multicolumn==CELL_BEGIN_OF_MULTICOLUMN) {
+               if (c_info[i][column + 1].multicolumn==CELL_BEGIN_OF_MULTICOLUMN)
+               {
                        c_info[i][column + 1].multicolumn = CELL_PART_OF_MULTICOLUMN;
                }
-               if ((column + 1) == columns_ ||
-                       c_info[i][column + 2].multicolumn != CELL_PART_OF_MULTICOLUMN) {
+               if ((column + 2) >= columns_ ||
+                       c_info[i][column + 2].multicolumn != CELL_PART_OF_MULTICOLUMN)
+               {
                        c_info[i][column + 1].multicolumn = LyXTabular::CELL_NORMAL;
                }
        }