]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/table.cpp
Fix bug #7668 (cosmetic whitespace issues)
[lyx.git] / src / tex2lyx / table.cpp
index e5862d043411afc697a9b1ca632a2abed3494cca..d23da08a73557e693648627615557da48350b2cb 100644 (file)
@@ -770,17 +770,24 @@ void handle_hline_below(RowInfo & ri, vector<CellInfo> & ci)
 } // anonymous namespace
 
 
-void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
-                   Context & context)
+void handle_tabular(Parser & p, ostream & os, string const & name,
+                    string const & tabularwidth, Context & context)
 {
+       bool const is_long_tabular(name == "longtable");
+       string tabularvalignment("middle");
        string posopts = p.getOpt();
        if (!posopts.empty()) {
                // FIXME: Convert this to ERT
                if (is_long_tabular)
-                       cerr << "horizontal longtable";
+                       cerr << "horizontal longtable positioning '"
+                            << posopts << "' ignored\n";
+               else if (posopts == "[t]")
+                       tabularvalignment = "top";
+               else if (posopts == "[b]")
+                       tabularvalignment = "bottom";
                else
-                       cerr << "vertical tabular";
-               cerr << " positioning '" << posopts << "' ignored\n";
+                       cerr << "vertical tabular positioning '"
+                            << posopts << "' ignored\n";
        }
 
        vector<ColInfo> colinfo;
@@ -1106,8 +1113,11 @@ void handle_tabular(Parser & p, ostream & os, bool is_long_tabular,
           << "\" columns=\"" << colinfo.size() << "\">\n";
        os << "<features"
           << write_attribute("rotate", false)
-          << write_attribute("islongtable", is_long_tabular)
-          << ">\n";
+          << write_attribute("islongtable", is_long_tabular);
+       if (!is_long_tabular)
+               os << write_attribute("tabularvalignment", tabularvalignment)
+                  << write_attribute("tabularwidth", tabularwidth);
+       os << ">\n";
 
        //cerr << "// after header\n";
        for (size_t col = 0; col < colinfo.size(); ++col) {