mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Fix bug 5766: http://bugzilla.lyx.org/show_bug.cgi?id=5766.
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:
parent
71c44aa9d0
commit
74163aa0cf
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user