]> git.lyx.org Git - features.git/commitdiff
Fixed \r reading for tabulars.
authorJürgen Vigna <jug@sad.it>
Wed, 14 Mar 2001 16:10:15 +0000 (16:10 +0000)
committerJürgen Vigna <jug@sad.it>
Wed, 14 Mar 2001 16:10:15 +0000 (16:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1758 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/tabular.C

index 7753d29183f8db17e9a15a2055490fa316ec2297..2a125b1cfb09c375d5ef6fb8f4e3b9c6f7cee5a4 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-14  Juergen Vigna  <jug@sad.it>
+
+       * tabular.C (l_getline): pay attention on \r\n (from Windows-files)
+
 2001-03-14  Lars Gullik Bjønnes  <larsbj@trylle.birdstep.com>
 
        * buffer.C: add hack to fix compability reading of minipages.
index 0dc9287192a0eeb709d7b78e355105843d0ed0b3..f8988a18fd94ccaefa973e235b8570243f014efb 100644 (file)
@@ -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 != "</cell>") {
+           if (!prefixIs(line, "</cell>")) {
                lyxerr << "Wrong tabular format (expected </cell> got" <<
                    line << ")" << endl;
                return;
            }
        }
        l_getline(is, line);
-       if (line != "</row>") {
+       if (!prefixIs(line, "</row>")) {
            lyxerr << "Wrong tabular format (expected </row> got" <<
                line << ")" << endl;
            return;
        }
     }
-    while (line != "</lyxtabular>") {
+    while (!prefixIs(line, "</lyxtabular>")) {
        l_getline(is, line);
     }
     set_row_column_number_info();