LyXTabular::LyXTabular(InsetTabular * inset, int rows_arg, int columns_arg)
{
owner_ = inset;
+ cur_cell = -1;
Init(rows_arg, columns_arg);
}
LyXTabular::LyXTabular(InsetTabular * inset, LyXTabular const & lt)
{
owner_ = inset;
+ cur_cell = -1;
Init(lt.rows_, lt.columns_, <);
#if 0
#ifdef WITH_WARNINGS
LyXTabular::LyXTabular(Buffer const * buf, InsetTabular * inset, LyXLex & lex)
{
owner_ = inset;
+ cur_cell = -1;
Read(buf, lex);
}
// So then it is ok to throw an exception, or for now
// call abort()
lyx::Assert(rows_ == lt.rows_ && columns_ == lt.columns_);
-
+ cur_cell = -1;
cell_info = lt.cell_info;
row_info = lt.row_info;
column_info = lt.column_info;
}
-LyXTabular * LyXTabular::Clone(InsetTabular * inset)
+LyXTabular * LyXTabular::clone(InsetTabular * inset)
{
LyXTabular * result = new LyXTabular(inset, *this);
#if 0
for (int i = 0; i < rows_; ++i) {
for (int j = 0; j < columns_; ++j) {
cell_info[i][j].inset.setOwner(owner_);
- cell_info[i][j].inset.SetDrawFrame(0, InsetText::LOCKED);
+ cell_info[i][j].inset.setDrawFrame(0, InsetText::LOCKED);
cell_info[i][j].cellno = cellno++;
}
cell_info[i].back().right_line = true;
cell_info[row][column].right_line =
cell_info[row][column+cn-1].right_line;
}
- cell_info[row][column].inset.SetAutoBreakRows(
+ cell_info[row][column].inset.setAutoBreakRows(
!GetPWidth(GetCellNumber(row, column)).empty());
}
}
for (int i = 0; i < rows_; ++i) {
int c = GetCellNumber(i, j);
flag = !GetPWidth(c).empty(); // because of multicolumns!
- GetCellInset(c)->SetAutoBreakRows(flag);
+ GetCellInset(c)->setAutoBreakRows(flag);
}
return true;
}
cellinfo_of_cell(cell)->p_width = width;
if (IsMultiColumn(cell)) {
- GetCellInset(cell)->SetAutoBreakRows(flag);
+ GetCellInset(cell)->setAutoBreakRows(flag);
return true;
}
return false;
<< write_attribute("special", cell_info[i][j].align_special)
<< ">\n";
os << "\\begin_inset ";
- cell_info[i][j].inset.Write(buf, os);
+ cell_info[i][j].inset.write(buf, os);
os << "\n\\end_inset \n"
<< "</cell>\n";
}
getTokenValue(line, "special", cell_info[i][j].align_special);
l_getline(is, line);
if (prefixIs(line, "\\begin_inset")) {
- cell_info[i][j].inset.Read(buf, lex);
+ cell_info[i][j].inset.read(buf, lex);
l_getline(is, line);
}
if (!prefixIs(line, "</cell>")) {
int pos = 0;
Paragraph::depth_type depth = 0;
LyXFont font(LyXFont::ALL_INHERIT);
- font.setLanguage(owner_->BufferOwner()->GetLanguage());
+ font.setLanguage(owner_->bufferOwner()->getLanguage());
while (lex.IsOK()) {
lex.nextToken();
lex.pushToken(token);
break;
}
- if (owner_->BufferOwner()->parseSingleLyXformat2Token(lex, par,
+ if (owner_->bufferOwner()->parseSingleLyXformat2Token(lex, par,
return_par,
token, pos,
depth, font)) {
par->insertChar(i, ' ');
}
}
- par->copyIntoMinibuffer(*owner_->BufferOwner(), i);
+ par->copyIntoMinibuffer(*owner_->bufferOwner(), i);
inset->par->insertFromMinibuffer(inset->par->size());
}
delete par;
if (rtl)
os << "\\R{";
- ret += inset->Latex(buf, os, fragile, fp);
+ ret += inset->latex(buf, os, fragile, fp);
if (rtl)
os << "}";
}
os << ">";
- ret += GetCellInset(cell)->DocBook(buf, os);
+ ret += GetCellInset(cell)->docBook(buf, os);
os << "</entry>";
++cell;
}
vector<unsigned int> const & clen) const
{
ostringstream sstr;
- int ret = GetCellInset(cell)->Ascii(buf, sstr, 0);
+ int ret = GetCellInset(cell)->ascii(buf, sstr, 0);
if (LeftLine(cell))
os << "| ";
if (IsMultiColumn(cell, true))
continue;
ostringstream sstr;
- GetCellInset(cell)->Ascii(buf, sstr, 0);
+ GetCellInset(cell)->ascii(buf, sstr, 0);
if (clen[j] < sstr.str().length())
clen[j] = sstr.str().length();
}
if (!IsMultiColumn(cell, true) || IsPartOfMultiColumn(i, j))
continue;
ostringstream sstr;
- GetCellInset(cell)->Ascii(buf, sstr, 0);
+ GetCellInset(cell)->ascii(buf, sstr, 0);
int len = int(sstr.str().length());
int const n = cells_in_multicolumn(cell);
for (int k = j; (len > 0) && (k < (j + n - 1)); ++k)
InsetText * LyXTabular::GetCellInset(int cell) const
{
+ cur_cell = cell;
return & cell_info[row_of_cell(cell)][column_of_cell(cell)].inset;
}
InsetText * LyXTabular::GetCellInset(int row, int column) const
{
+#ifdef WITH_WARNINGS
+#warning Juergen, should we check whether the row/column values are correct?
+// If we do not need to do that, the tests in GetCellNumber should be
+// changed to asserts.
+#endif
+ cur_cell = GetCellNumber(row, column);
return & cell_info[row][column].inset;
}
for (int cell = 0; !features.array && (cell < numberofcells); ++cell) {
if (GetVAlignment(cell) != LYX_VALIGN_TOP)
features.array = true;
- GetCellInset(cell)->Validate(features);
+ GetCellInset(cell)->validate(features);
}
}