From 898a191c486cbf6dc49f217d24326c0457229220 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Wed, 14 Mar 2001 16:10:15 +0000 Subject: [PATCH] Fixed \r reading for tabulars. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1758 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/tabular.C | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7753d29183..2a125b1cfb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-03-14 Juergen Vigna + + * tabular.C (l_getline): pay attention on \r\n (from Windows-files) + 2001-03-14 Lars Gullik Bjønnes * buffer.C: add hack to fix compability reading of minipages. diff --git a/src/tabular.C b/src/tabular.C index 0dc9287192..f8988a18fd 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -1226,7 +1226,7 @@ static inline void l_getline(istream & is, string & str) { getline(is, str); - while(str.empty()) + while(str.empty() || ((str.length()==1) && (str[0] == '\r'))) getline(is, str); } @@ -1325,20 +1325,20 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is, cell_info[i][j].inset.Read(buf, lex); l_getline(is, line); } - if (line != "") { + if (!prefixIs(line, "")) { lyxerr << "Wrong tabular format (expected got" << line << ")" << endl; return; } } l_getline(is, line); - if (line != "") { + if (!prefixIs(line, "")) { lyxerr << "Wrong tabular format (expected got" << line << ")" << endl; return; } } - while (line != "") { + while (!prefixIs(line, "")) { l_getline(is, line); } set_row_column_number_info(); -- 2.39.5