]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/table.C
Add a Buffer::fully_loaded member function, returning true only when
[lyx.git] / src / tex2lyx / table.C
index ac1b44eddff8ae6a13a0e0cf3238aa7bbc135f9e..cbbb7225b85c7139dec02811df44e484355a33ad 100644 (file)
@@ -1,5 +1,12 @@
-/** The .tex to .lyx converter
-    \author André Pönitz (2003)
+/**
+ * \file table.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ * \author Jean-Marc Lasgouttes
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 // {[(
@@ -22,7 +29,6 @@ using std::ostream;
 using std::ostringstream;
 using std::string;
 using std::vector;
-using std::map;
 
 #include "mathed/math_gridinfo.h"
 
@@ -136,7 +142,7 @@ void handle_colalign(Parser & p, vector<ColInfo> & colinfo)
                                        ci.special += t.character();
                                        int const nargs = special_columns[t.character()];
                                        for (int i = 0; i < nargs; ++i)
-                                               ci.special += "{" + p.verbatim_item() + "}"; 
+                                               ci.special += "{" + p.verbatim_item() + "}";
                                        //cerr << "handling special column '" << t << "' " << nargs
                                        //      << "  '" << ci.special << "'\n";
                                        colinfo.push_back(ci);
@@ -259,7 +265,7 @@ void parse_table(Parser & p, ostream & os, unsigned flags)
                        p.error("found 'end' unexpectedly");
                }
 
-               else 
+               else
                        os << t.asInput();
        }
 }
@@ -306,7 +312,7 @@ void handle_tabular(Parser & p, ostream & os,
 
        vector< vector<CellInfo> > cellinfo(lines.size());
        vector<RowInfo> rowinfo(lines.size());
-       
+
        // split into rows
        //cerr << "// split into rows\n";
        for (size_t row = 0; row < rowinfo.size(); ++row) {
@@ -314,7 +320,7 @@ void handle_tabular(Parser & p, ostream & os,
                // init row
                cellinfo[row].resize(colinfo.size());
 
-               // split row    
+               // split row
                vector<string> dummy;
                //cerr << "\n########### LINE: " << lines[row] << "########\n";
                split(lines[row], dummy, HLINE);
@@ -332,7 +338,7 @@ void handle_tabular(Parser & p, ostream & os,
                //cerr << "line: " << row << " below 2: " << dummy[2] <<  "\n";
                //cerr << "line: " << row << " cells 1: " << dummy[1] <<  "\n";
 
-               for (int i = 0; i <= 2; i += 2) {       
+               for (int i = 0; i <= 2; i += 2) {
                        //cerr << "   reading from line string '" << dummy[i] << "'\n";
                        Parser p1(dummy[i]);
                        while (p1.good()) {
@@ -350,7 +356,7 @@ void handle_tabular(Parser & p, ostream & os,
                                                        handle_hline_above(rowinfo[row], cellinfo[row]);
                                                        //cerr << "above row: " << row << endl;
                                                }
-                                       } else {        
+                                       } else {
                                                //cerr << "below row: " << row << endl;
                                                handle_hline_below(rowinfo[row], cellinfo[row]);
                                        }
@@ -385,14 +391,14 @@ void handle_tabular(Parser & p, ostream & os,
                                cell < cells.size() && col < colinfo.size(); ++col, ++cell) {
                        //cerr << "cell content: '" << cells[cell] << "'\n";
                        Parser p(cells[cell]);
-                       p.skip_spaces();        
+                       p.skip_spaces();
                        //cells[cell] << "'\n";
                        if (p.next_token().cs() == "multicolumn") {
                                // how many cells?
                                p.get_token();
                                size_t const ncells = string2int(p.verbatim_item());
 
-                               // special cell properties alignment    
+                               // special cell properties alignment
                                vector<ColInfo> t;
                                handle_colalign(p, t);
                                cellinfo[row][col].multi     = 1;
@@ -414,7 +420,7 @@ void handle_tabular(Parser & p, ostream & os,
                                if (t.front().rightline > 1)
                                        cellinfo[row][col + 1].leftline = true;
 
-                       } else {        
+                       } else {
                                // FLAG_END is a hack, we need to read all of it
                                cellinfo[row][col].leftline = colinfo[col].leftline;
                                cellinfo[row][col].rightline = colinfo[col].rightline;
@@ -474,7 +480,7 @@ void handle_tabular(Parser & p, ostream & os,
                        os << "<cell";
                        if (cell.multi)
                                os << " multicolumn=\"" << cell.multi << "\"";
-                       os << " alignment=\"" << verbose_align(cell.align) 
+                       os << " alignment=\"" << verbose_align(cell.align)
                           << "\""
                           << " valignment=\"top\"";
                        if (cell.topline)
@@ -499,7 +505,7 @@ void handle_tabular(Parser & p, ostream & os,
                }
                os << "</row>\n";
        }
-                       
+
        os << "</lyxtabular>\n";
 }