#include "support/convert.h"
#include "support/lstrings.h"
+#include <algorithm>
#include <iostream>
#include <sstream>
#include <vector>
namespace lyx {
-// filled in preamble.cpp
-map<char, int> special_columns;
-
namespace {
class ltType {
public:
// constructor
- ltType() : topDL(false), bottomDL(false), empty(false) {}
+ ltType() : set(false), topDL(false), bottomDL(false), empty(false) {}
// we have this header type (is set in the getLT... functions)
bool set;
// double borders on top
next.special += t.character();
next.special += '{' + p.verbatim_item() + '}';
break;
- default:
+ default: {
// try user defined column types
- if (special_columns.find(t.character()) !=
- special_columns.end()) {
- ci2special(next);
- next.special += t.character();
- int const nargs =
- special_columns[t.character()];
- for (int i = 0; i < nargs; ++i)
- next.special += '{' +
- p.verbatim_item() +
- '}';
- colinfo.push_back(next);
- next = ColInfo();
- } else
- cerr << "Ignoring column specification"
- " '" << t << "'." << endl;
+ // unknown column types (nargs == -1) are
+ // assumed to consume no arguments
+ ci2special(next);
+ next.special += t.character();
+ int const nargs =
+ preamble.getSpecialTableColumnArguments(t.character());
+ for (int i = 0; i < nargs; ++i)
+ next.special += '{' +
+ p.verbatim_item() + '}';
+ colinfo.push_back(next);
+ next = ColInfo();
break;
}
+ }
}
// Maybe we have some column separators that need to be added to the
// treat the nested environment as a block, don't
// parse &, \\ etc, because they don't belong to our
// table if they appear.
- os << p.verbatimEnvironment(name);
+ os << p.ertEnvironment(name);
os << "\\end{" << name << '}';
active_environments.pop_back();
}
angle = p.getArg('{', '}');
}
active_environments.push_back(env);
- p.verbatimEnvironment(env);
+ p.ertEnvironment(env);
active_environments.pop_back();
p.skip_spaces();
if (!p.good() && support::isStrInt(angle))