From: Jürgen Vigna Date: Tue, 21 Dec 1999 15:43:47 +0000 (+0000) Subject: Fixed bug which crashed LyX when reading old tabular format X-Git-Tag: 1.6.10~22457 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=23297eadbdc10f0df6a3be61004a32e8539bce77;p=features.git Fixed bug which crashed LyX when reading old tabular format git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@391 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 1386aaeeb2..0d710f2a17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-12-21 Juergen Vigna + + * src/table.C (Read): Now read bogus row format informations + if the format is < 5 so that afterwards the table can + be read by lyx but without any format-info. Fixed the + crash we experienced when not doing this. + 1999-12-21 Lars Gullik Bjønnes * src/text2.C (RedoHeightOfParagraph): rename arg cursor -> cur diff --git a/src/table.C b/src/table.C index 0c454dcb25..ac5b6487d3 100644 --- a/src/table.C +++ b/src/table.C @@ -872,13 +872,36 @@ void LyXTable::Read(FILE * file) #ifdef WITH_WARNINGS #warning Insert a error message window here that this format is not supported anymore #endif + a = b = c = d = -1; if (version < 5) { - lyxerr << "Tabular format < 5 is not supported anymore\n" - "Get an older version of LyX (< 1.1.x) for conversion!" - << endl; + lyxerr << "Tabular format < 5 is not supported anymore\n" + "Get an older version of LyX (< 1.1.x) for conversion!" + << endl; + if (version > 2) { + fgets(vtmp,sizeof(vtmp),file); + sscanf(vtmp, "%d %d %d %d %d %d %d %d\n", + &rows_arg, &columns_arg, + &is_long_table_arg, &rotate_arg, &a, &b, &c, &d); + } else + fscanf(file, "%d %d\n", + &rows_arg, &columns_arg); + Init(rows_arg, columns_arg); + SetLongTable(is_long_table_arg); + SetRotateTable(rotate_arg); + for (i = 0; i