Crash when selecting a row and doing "Delete column" in a table with multicolumns.

The check "column + 1 < column_info.size()" checks whether there is at least one column after this one. However, this check is no longer valid if we remove the column from column_info first.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28419 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-02-09 19:39:28 +00:00
parent 71c44aa9d0
commit 74163aa0cf

View File

@ -730,8 +730,7 @@ void Tabular::deleteColumn(col_type const column)
if (column_info.size() == 1)
return;
column_info.erase(column_info.begin() + column);
size_t row_count = row_info.size();
size_t const row_count = row_info.size();
for (row_type i = 0; i < row_count; ++i) {
// Care about multicolumn cells
if (column + 1 < column_info.size() &&
@ -741,6 +740,7 @@ void Tabular::deleteColumn(col_type const column)
}
cell_info[i].erase(cell_info[i].begin() + column);
}
column_info.erase(column_info.begin() + column);
updateIndexes();
}