tex2lyx/table.cpp: fix bug #8204 also for branch (prevent crash if TeX files define wrong table column numbers)

This commit is contained in:
Uwe Stöhr 2012-06-23 01:13:43 +02:00
parent 451ee220f4
commit b835e6e03b
2 changed files with 15 additions and 1 deletions

View File

@ -1156,8 +1156,20 @@ void handle_tabular(Parser & p, ostream & os, string const & name,
cellinfo[row][col].content += os.str();
// add dummy cells for multicol
for (size_t i = 0; i < ncells - 1 && col < colinfo.size(); ++i) {
for (size_t i = 0; i < ncells - 1; ++i) {
++col;
if (col >= colinfo.size()) {
cerr << "The cell '"
<< cells[cell]
<< "' specifies "
<< convert<string>(ncells)
<< " columns while the table has only "
<< convert<string>(colinfo.size())
<< " columns!"
<< " Therefore the surplus columns will be ignored."
<< endl;
break;
}
cellinfo[row][col].multi = CELL_PART_OF_MULTICOLUMN;
cellinfo[row][col].align = 'c';
}

View File

@ -276,6 +276,8 @@ What's new
- Fix missing backslash in import of \def ... \csname ... \endcsname (bug 8116).
- Fix crash if TeX-files contain table logic bugs (bug 8204).
* ADVANCED FIND AND REPLACE