+MathArrayInset::MathArrayInset(string const & name, string const & str)
+ : MathGridInset(1, 1), name_(name)
+{
+ vector< vector<string> > dat;
+ istringstream is(str.c_str());
+ string line;
+ while (getline(is, line)) {
+ istringstream ls(line.c_str());
+ typedef istream_iterator<string> iter;
+ vector<string> v = vector<string>(iter(ls), iter());
+ if (v.size())
+ dat.push_back(v);
+ }
+
+ for (row_type row = 1; row < dat.size(); ++row)
+ addRow(0);
+ 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[0].size(); ++col)
+ mathed_parse_cell(cell(index(row, col)), dat[row][col]);
+}
+
+