]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.C
fix some C++ parsing bugs
[lyx.git] / src / tabular.C
index dcf10bba2a5abaaf36db45c8840fac480c623a16..bc38b967facee396db09906995d1a103c51e83e0 100644 (file)
@@ -1446,17 +1446,12 @@ void LyXTabular::OldFormatRead(BufferParams const & bp,
        }
        set_row_column_number_info(true);
 
-       Paragraph * par = new Paragraph;
-       Paragraph * return_par = 0;
-
-       par->layout(bp.getLyXTextClass().defaultLayout());
-
        string tmptok;
-       int pos = 0;
        Paragraph::depth_type depth = 0;
-       LyXFont font(LyXFont::ALL_INHERIT);
-       font.setLanguage(owner_->bufferOwner()->getLanguage());
 
+       ParagraphList parlist;
+       ParagraphList::iterator pit = parlist.begin();
+       
        while (lex.isOK()) {
                lex.nextToken();
                string const token = lex.getString();
@@ -1470,22 +1465,17 @@ void LyXTabular::OldFormatRead(BufferParams const & bp,
                        lex.pushToken(token);
                        break;
                }
-               if (owner_->bufferOwner()->parseSingleLyXformat2Token(lex, par,
-                                                                                                                         return_par,
-                                                                                                                         token, pos,
-                                                                                                                         depth, font)) {
-                       // the_end read
-                       lex.pushToken(token);
-                       break;
-               }
-               if (return_par) {
-                       lex.printError("New Paragraph allocated! This should not happen!");
+
+               if (token == "\\the_end") {
                        lex.pushToken(token);
-                       delete par;
-                       par = return_par;
                        break;
                }
+
+               owner_->bufferOwner()->readParagraph(lex, token, parlist, pit, depth);
        }
+
+       Paragraph * par = &(*parlist.begin());
+
        // now we have the par we should fill the insets with this!
        int cell = 0;
        InsetText * inset = GetCellInset(cell);
@@ -2776,7 +2766,7 @@ LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
 
        for (; cit != end; ++cit) {
                for (int i = 0; i < cit->size(); ++i) {
-                       if (cit->getChar(i) == Paragraph::META_NEWLINE)
+                       if (cit->isNewline(i))
                                return BOX_PARBOX;
                }
        }