using std::vector;
using std::istringstream;
using std::getline;
+using std::istream_iterator;
MathArrayInset::MathArrayInset(string const & name, int m, int n)
{
vector< vector<string> > dat;
istringstream is(str.c_str());
- while (is) {
- string line;
- getline(is, line);
+ string line;
+ while (getline(is, line)) {
istringstream ls(line.c_str());
- typedef std::istream_iterator<string> iter;
+ typedef istream_iterator<string> iter;
vector<string> v = vector<string>(iter(ls), iter());
if (v.size())
dat.push_back(v);
for (col_type col = 1; col < dat[0].size(); ++col)
addCol(0);
for (row_type row = 0; row < dat.size(); ++row)
- for (col_type col = 0; col < dat[row].size(); ++col)
+ for (col_type col = 0; col < dat[0].size(); ++col)
mathed_parse_cell(cell(index(row, col)), dat[row][col]);
}
}
-void MathArrayInset::metrics(MathMetricsInfo const & st) const
+void MathArrayInset::metrics(MathMetricsInfo & mi) const
{
- MathMetricsInfo mi = st;
- if (mi.style == LM_ST_DISPLAY)
- mi.style = LM_ST_TEXT;
- MathGridInset::metrics(mi);
+ MathMetricsInfo m = mi;
+ if (m.base.style == LM_ST_DISPLAY)
+ m.base.style = LM_ST_TEXT;
+ MathGridInset::metrics(m);
}
os << "\\protect";
os << "\\begin{" << name_ << "}";
- if (v_align_ == 't' || v_align_ == 'b')
+ if (v_align_ == 't' || v_align_ == 'b')
os << '[' << char(v_align_) << ']';
os << '{' << halign() << "}\n";