+2003-06-12 André Pönitz <poenitz@gmx.net>
+
+ * tabular.C:
+ * tabular.h:
+ * tabular_funcs.h: some renaming plus whitespace
+
2003-06-12 André Pönitz <poenitz@gmx.net>
* BufferView.C:
void ControlTabular::toggleTopLine()
{
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(LyXTabular::M_TOGGLE_LINE_TOP);
else
set(LyXTabular::TOGGLE_LINE_TOP);
void ControlTabular::toggleBottomLine()
{
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(LyXTabular::M_TOGGLE_LINE_BOTTOM);
else
set(LyXTabular::TOGGLE_LINE_BOTTOM);
void ControlTabular::toggleLeftLine()
{
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(LyXTabular::M_TOGGLE_LINE_LEFT);
else
set(LyXTabular::TOGGLE_LINE_LEFT);
void ControlTabular::toggleRightLine()
{
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(LyXTabular::M_TOGGLE_LINE_RIGHT);
else
set(LyXTabular::TOGGLE_LINE_RIGHT);
void ControlTabular::setSpecial(string const & special)
{
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(LyXTabular::SET_SPECIAL_MULTI, special);
else
set(LyXTabular::SET_SPECIAL_COLUMN, special);
void ControlTabular::setWidth(string const & width)
{
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(LyXTabular::SET_MPWIDTH, width);
else
set(LyXTabular::SET_PWIDTH, width);
break;
}
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(multi_num);
else
set(num);
break;
}
- if (tabular().IsMultiColumn(getActiveCell()))
+ if (tabular().isMultiColumn(getActiveCell()))
set(multi_num);
else
set(num);
{
LyXTabular const & tabular = controller().tabular();
int const cell = controller().getActiveCell();
- bool const isMulticolumnCell = tabular.IsMultiColumn(cell);
+ bool const isMulticolumnCell = tabular.isMultiColumn(cell);
if (!isMulticolumnCell) {
dialog_->borders->setLeftEnabled(true);
dialog_->borders->setRightEnabled(true);
- dialog_->borders->setTop(tabular.TopLine(cell, true));
- dialog_->borders->setBottom(tabular.BottomLine(cell, true));
- dialog_->borders->setLeft(tabular.LeftLine(cell, true));
- dialog_->borders->setRight(tabular.RightLine(cell, true));
+ dialog_->borders->setTop(tabular.topLine(cell, true));
+ dialog_->borders->setBottom(tabular.bottomLine(cell, true));
+ dialog_->borders->setLeft(tabular.leftLine(cell, true));
+ dialog_->borders->setRight(tabular.rightLine(cell, true));
// repaint the setborder widget
dialog_->borders->repaint();
return;
}
- dialog_->borders->setTop(tabular.TopLine(cell));
- dialog_->borders->setBottom(tabular.BottomLine(cell));
+ dialog_->borders->setTop(tabular.topLine(cell));
+ dialog_->borders->setBottom(tabular.bottomLine(cell));
// pay attention to left/right lines: they are only allowed
// to set if we are in first/last cell of row or if the left/right
// cell is also a multicolumn.
- if (tabular.IsFirstCellInRow(cell) || tabular.IsMultiColumn(cell - 1)) {
+ if (tabular.isFirstCellInRow(cell) || tabular.isMultiColumn(cell - 1)) {
dialog_->borders->setLeftEnabled(true);
- dialog_->borders->setLeft(tabular.LeftLine(cell));
+ dialog_->borders->setLeft(tabular.leftLine(cell));
} else {
dialog_->borders->setLeft(false);
dialog_->borders->setLeftEnabled(false);
}
- if (tabular.IsLastCellInRow(cell) || tabular.IsMultiColumn(cell + 1)) {
+ if (tabular.isLastCellInRow(cell) || tabular.isMultiColumn(cell + 1)) {
dialog_->borders->setRightEnabled(true);
- dialog_->borders->setRight(tabular.RightLine(cell));
+ dialog_->borders->setRight(tabular.rightLine(cell));
} else {
dialog_->borders->setRight(false);
dialog_->borders->setRightEnabled(false);
dialog_->tabularRowED->setText(toqstr(tostr(row + 1)));
dialog_->tabularColumnED->setText(toqstr(tostr(col + 1)));
- bool const multicol(tabular.IsMultiColumn(cell));
+ bool const multicol(tabular.isMultiColumn(cell));
dialog_->multicolumnCB->setChecked(multicol);
- dialog_->rotateCellCB->setChecked(tabular.GetRotateCell(cell));
- dialog_->rotateTabularCB->setChecked(tabular.GetRotateTabular());
+ dialog_->rotateCellCB->setChecked(tabular.getRotateCell(cell));
+ dialog_->rotateTabularCB->setChecked(tabular.getRotateTabular());
- dialog_->longTabularCB->setChecked(tabular.IsLongTabular());
+ dialog_->longTabularCB->setChecked(tabular.isLongTabular());
update_borders();
string special;
if (multicol) {
- special = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
- pwidth = tabular.GetMColumnPWidth(cell);
+ special = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
+ pwidth = tabular.getMColumnPWidth(cell);
} else {
- special = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
- pwidth = tabular.GetColumnPWidth(cell);
+ special = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
+ pwidth = tabular.getColumnPWidth(cell);
}
dialog_->specialAlignmentED->setText(toqstr(special));
dialog_->hAlignCB->insertItem(qt_("Block"));
int align = 0;
- switch (tabular.GetAlignment(cell)) {
+ switch (tabular.getAlignment(cell)) {
case LYX_ALIGN_LEFT:
align = 0;
break;
dialog_->hAlignCB->setCurrentItem(align);
int valign = 0;
- switch (tabular.GetVAlignment(cell)) {
+ switch (tabular.getVAlignment(cell)) {
case LyXTabular::LYX_VALIGN_TOP:
valign = 0;
break;
dialog_->hAlignCB->setEnabled(true);
dialog_->vAlignCB->setEnabled(!pwidth.zero());
- if (!tabular.IsLongTabular()) {
+ if (!tabular.isLongTabular()) {
dialog_->headerStatusCB->setChecked(false);
dialog_->headerBorderAboveCB->setChecked(false);
dialog_->headerBorderBelowCB->setChecked(false);
LyXTabular::ltType ltt;
bool use_empty;
- bool row_set = tabular.GetRowOfLTHead(row, ltt);
+ bool row_set = tabular.getRowOfLTHead(row, ltt);
dialog_->headerStatusCB->setChecked(row_set);
if (ltt.set) {
dialog_->headerBorderAboveCB->setChecked(ltt.topDL);
use_empty = false;
}
- row_set = tabular.GetRowOfLTFirstHead(row, ltt);
+ row_set = tabular.getRowOfLTFirstHead(row, ltt);
dialog_->firstheaderStatusCB->setChecked(row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
dialog_->firstheaderBorderAboveCB->setChecked(ltt.topDL);
}
}
- row_set = tabular.GetRowOfLTFoot(row, ltt);
+ row_set = tabular.getRowOfLTFoot(row, ltt);
dialog_->footerStatusCB->setChecked(row_set);
if (ltt.set) {
dialog_->footerBorderAboveCB->setChecked(ltt.topDL);
use_empty = false;
}
- row_set = tabular.GetRowOfLTLastFoot(row, ltt);
+ row_set = tabular.getRowOfLTLastFoot(row, ltt);
dialog_->lastfooterStatusCB->setChecked(row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
dialog_->lastfooterBorderAboveCB->setChecked(ltt.topDL);
dialog_->lastfooterStatusCB->setEnabled(false);
}
}
- dialog_->newpageCB->setChecked(tabular.GetLTNewPage(row));
+ dialog_->newpageCB->setChecked(tabular.getLTNewPage(row));
}
// apply the fixed width values
int const cell = controller().getActiveCell();
- bool const multicol(tabular.IsMultiColumn(cell));
+ bool const multicol = tabular.isMultiColumn(cell);
string width = widgetsToLength(dialog_->widthED, dialog_->widthUnit);
string width2;
- LyXLength llen(tabular.GetColumnPWidth(cell));
- LyXLength llenMulti(tabular.GetMColumnPWidth(cell));
+ LyXLength llen = tabular.getColumnPWidth(cell);
+ LyXLength llenMulti = tabular.getMColumnPWidth(cell);
if (multicol && !llenMulti.zero())
width2 = llenMulti.asString();
string sa2;
if (multicol)
- sa2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
+ sa2 = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
else
- sa2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
+ sa2 = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
if (sa1 != sa2) {
if (multicol)
sprintf(buf, "%d", row + 1);
fl_set_input(dialog_->input_tabular_row, buf);
fl_deactivate_object(dialog_->input_tabular_row);
- if (tabular.IsMultiColumn(cell)) {
+ if (tabular.isMultiColumn(cell)) {
fl_set_button(cell_options_->check_multicolumn, 1);
fl_set_button(cell_options_->check_border_top,
- tabular.TopLine(cell)?1:0);
+ tabular.topLine(cell)?1:0);
setEnabled(cell_options_->check_border_top, true);
fl_set_button(cell_options_->check_border_bottom,
- tabular.BottomLine(cell)?1:0);
+ tabular.bottomLine(cell)?1:0);
setEnabled(cell_options_->check_border_bottom, true);
// pay attention to left/right lines they are only allowed
// to set if we are in first/last cell of row or if the left/right
// cell is also a multicolumn.
- if (tabular.IsFirstCellInRow(cell) ||
- tabular.IsMultiColumn(cell-1)) {
+ if (tabular.isFirstCellInRow(cell) ||
+ tabular.isMultiColumn(cell-1)) {
fl_set_button(cell_options_->check_border_left,
- tabular.LeftLine(cell)?1:0);
+ tabular.leftLine(cell)?1:0);
setEnabled(cell_options_->check_border_left, true);
} else {
fl_set_button(cell_options_->check_border_left, 0);
setEnabled(cell_options_->check_border_left, false);
}
- if (tabular.IsLastCellInRow(cell) ||
- tabular.IsMultiColumn(cell+1)) {
+ if (tabular.isLastCellInRow(cell) ||
+ tabular.isMultiColumn(cell+1)) {
fl_set_button(cell_options_->check_border_right,
- tabular.RightLine(cell)?1:0);
+ tabular.rightLine(cell)?1:0);
setEnabled(cell_options_->check_border_right, true);
} else {
fl_set_button(cell_options_->check_border_right, 0);
setEnabled(cell_options_->check_border_right, false);
}
- pwidth = tabular.GetMColumnPWidth(cell);
- align = tabular.GetAlignment(cell);
+ pwidth = tabular.getMColumnPWidth(cell);
+ align = tabular.getAlignment(cell);
// set the horiz. alignment, default is left here
fl_set_button(cell_options_->radio_align_left, 0);
fl_set_button(cell_options_->radio_align_right, 0);
else
fl_set_button(cell_options_->radio_align_left, 1);
- align = tabular.GetVAlignment(cell);
+ align = tabular.getVAlignment(cell);
fl_set_button(cell_options_->radio_valign_top, 0);
fl_set_button(cell_options_->radio_valign_bottom, 0);
fl_set_button(cell_options_->radio_valign_center, 0);
else
fl_set_button(cell_options_->radio_valign_top, 1);
- special = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
+ special = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
fl_set_input(cell_options_->input_special_multialign, special.c_str());
bool const metric(controller().useMetricUnits());
string const default_unit = metric ? "cm" : "in";
setEnabled(cell_options_->input_mcolumn_width, false);
setEnabled(cell_options_->choice_value_mcolumn_width, false);
}
- if (tabular.GetRotateCell(cell))
+ if (tabular.getRotateCell(cell))
fl_set_button(cell_options_->check_rotate_cell, 1);
else
fl_set_button(cell_options_->check_rotate_cell, 0);
- if (tabular.TopLine(cell, true))
+ if (tabular.topLine(cell, true))
fl_set_button(column_options_->check_border_top, 1);
else
fl_set_button(column_options_->check_border_top, 0);
- if (tabular.BottomLine(cell, true))
+ if (tabular.bottomLine(cell, true))
fl_set_button(column_options_->check_border_bottom, 1);
else
fl_set_button(column_options_->check_border_bottom, 0);
- if (tabular.LeftLine(cell, true))
+ if (tabular.leftLine(cell, true))
fl_set_button(column_options_->check_border_left, 1);
else
fl_set_button(column_options_->check_border_left, 0);
- if (tabular.RightLine(cell, true))
+ if (tabular.rightLine(cell, true))
fl_set_button(column_options_->check_border_right, 1);
else
fl_set_button(column_options_->check_border_right, 0);
- special = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
+ special = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
fl_set_input(column_options_->input_special_alignment, special.c_str());
bool const isReadonly = bc().bp().isReadOnly();
setEnabled(column_options_->input_special_alignment, !isReadonly);
- pwidth = tabular.GetColumnPWidth(cell);
+ pwidth = tabular.getColumnPWidth(cell);
bool const metric = controller().useMetricUnits();
string const default_unit = metric ? "cm" : "in";
updateWidgetsFromLength(column_options_->input_column_width,
setEnabled(cell_options_->check_useminipage, !pwidth.zero());
if (!pwidth.zero()) {
- if (tabular.GetUsebox(cell) == 2)
+ if (tabular.getUsebox(cell) == 2)
fl_set_button(cell_options_->check_useminipage, 1);
else
fl_set_button(cell_options_->check_useminipage, 0);
} else {
fl_set_button(cell_options_->check_useminipage, 0);
}
- align = tabular.GetAlignment(cell, true);
+ align = tabular.getAlignment(cell, true);
fl_set_button(column_options_->radio_align_left, 0);
fl_set_button(column_options_->radio_align_right, 0);
fl_set_button(column_options_->radio_align_center, 0);
fl_set_button(column_options_->radio_align_center, 1);
else
fl_set_button(column_options_->radio_align_block, 1);
- align = tabular.GetVAlignment(cell, true);
+ align = tabular.getVAlignment(cell, true);
fl_set_button(column_options_->radio_valign_top, 0);
fl_set_button(column_options_->radio_valign_bottom, 0);
fl_set_button(column_options_->radio_valign_center, 0);
setEnabled(column_options_->radio_valign_center, !pwidth.zero());
fl_set_button(tabular_options_->check_longtable,
- tabular.IsLongTabular());
+ tabular.isLongTabular());
- bool const enable = tabular.IsLongTabular();
+ bool const enable = tabular.isLongTabular();
setEnabled(longtable_options_->check_lt_firsthead, enable);
setEnabled(longtable_options_->check_1head_2border_above, enable);
if (enable) {
LyXTabular::ltType ltt;
bool use_empty;
- bool row_set = tabular.GetRowOfLTHead(row, ltt);
+ bool row_set = tabular.getRowOfLTHead(row, ltt);
fl_set_button(longtable_options_->check_lt_head, row_set);
if (ltt.set) {
fl_set_button(longtable_options_->check_head_2border_above,
use_empty = false;
}
//
- row_set = tabular.GetRowOfLTFirstHead(row, ltt);
+ row_set = tabular.getRowOfLTFirstHead(row, ltt);
fl_set_button(longtable_options_->check_lt_firsthead, row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
fl_set_button(longtable_options_->check_1head_2border_above,
}
}
//
- row_set = tabular.GetRowOfLTFoot(row, ltt);
+ row_set = tabular.getRowOfLTFoot(row, ltt);
fl_set_button(longtable_options_->check_lt_foot, row_set);
if (ltt.set) {
fl_set_button(longtable_options_->check_foot_2border_above,
use_empty = false;
}
//
- row_set = tabular.GetRowOfLTLastFoot(row, ltt);
+ row_set = tabular.getRowOfLTLastFoot(row, ltt);
fl_set_button(longtable_options_->check_lt_lastfoot, row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
fl_set_button(longtable_options_->check_lastfoot_2border_above,
}
}
fl_set_button(longtable_options_->check_lt_newpage,
- tabular.GetLTNewPage(row));
+ tabular.getLTNewPage(row));
} else {
fl_set_button(longtable_options_->check_lt_firsthead, 0);
fl_set_button(longtable_options_->check_1head_2border_above, 0);
fl_set_button(longtable_options_->check_lt_newpage, 0);
}
fl_set_button(tabular_options_->check_rotate_tabular,
- tabular.GetRotateTabular());
+ tabular.getRotateTabular());
}
getLengthFromWidgets(column_options_->input_column_width,
column_options_->choice_value_column_width);
string w2;
- LyXLength llen = tabular.GetColumnPWidth(cell);
+ LyXLength llen = tabular.getColumnPWidth(cell);
if (!llen.zero())
w2 = llen.asString();
string mw1 = getLengthFromWidgets(cell_options_->input_mcolumn_width,
cell_options_->choice_value_mcolumn_width);
- llen = tabular.GetMColumnPWidth(cell);
+ llen = tabular.getMColumnPWidth(cell);
string mw2;
if (llen.zero())
mw2 = "";
mw2 = llen.asString();
string al1 = getString(column_options_->input_special_alignment);
- string al2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
+ string al2 = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN);
string mal1 = getString(cell_options_->input_special_multialign);
- string mal2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
+ string mal2 = tabular.getAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI);
// we must do these all at the end
if (w1 != w2)
+
+2003-06-12 André Pönitz <poenitz@gmx.net>
+
+ * insettabular.[Ch]: some renaming plus whitespace
+
2003-06-11 Angus Leeming <leeming@lyx.org>
* Makefile.am: remove graphicinset.[Ch], insetbutton.[Ch].
void InsetTabular::write(Buffer const * buf, ostream & os) const
{
os << " Tabular" << endl;
- tabular->Write(buf, os);
+ tabular->write(buf, os);
}
void InsetTabular::metrics(MetricsInfo &,
Dimension & dim) const
{
- dim.asc = tabular->GetAscentOfRow(0);
- dim.des = tabular->GetHeightOfTabular() - tabular->GetAscentOfRow(0) + 1;
- dim.wid = tabular->GetWidthOfTabular() + 2 * ADD_TO_TABULAR_WIDTH;
+ dim.asc = tabular->getAscentOfRow(0);
+ dim.des = tabular->getHeightOfTabular() - tabular->getAscentOfRow(0) + 1;
+ dim.wid = tabular->getWidthOfTabular() + 2 * ADD_TO_TABULAR_WIDTH;
}
first_visible_cell = -1;
for (i = 0; i < tabular->rows(); ++i) {
nx = x;
- cell = tabular->GetCellNumber(i, 0);
- if (!((y + tabular->GetDescentOfRow(i)) > 0) &&
- (y - tabular->GetAscentOfRow(i)) < pi.pain.paperHeight())
+ cell = tabular->getCellNumber(i, 0);
+ if (!((y + tabular->getDescentOfRow(i)) > 0) &&
+ (y - tabular->getAscentOfRow(i)) < pi.pain.paperHeight())
{
- y += tabular->GetDescentOfRow(i) +
- tabular->GetAscentOfRow(i + 1) +
- tabular->GetAdditionalHeight(i + 1);
+ y += tabular->getDescentOfRow(i) +
+ tabular->getAscentOfRow(i + 1) +
+ tabular->getAdditionalHeight(i + 1);
continue;
}
for (j = 0; j < tabular->columns(); ++j) {
if (nx > bv->workWidth())
break;
- if (tabular->IsPartOfMultiColumn(i, j))
+ if (tabular->isPartOfMultiColumn(i, j))
continue;
- cx = nx + tabular->GetBeginningOfTextInCell(cell);
+ cx = nx + tabular->getBeginningOfTextInCell(cell);
if (first_visible_cell < 0)
first_visible_cell = cell;
if (hasSelection()) {
drawCellSelection(pi.pain, nx, y, i, j, cell);
}
- tabular->GetCellInset(cell)->draw(pi, cx, y);
+ tabular->getCellInset(cell)->draw(pi, cx, y);
drawCellLines(pi.pain, nx, y, i, cell);
- nx += tabular->GetWidthOfColumn(cell);
+ nx += tabular->getWidthOfColumn(cell);
++cell;
}
break;
#endif
- y += tabular->GetDescentOfRow(i) +
- tabular->GetAscentOfRow(i + 1) +
- tabular->GetAdditionalHeight(i + 1);
+ y += tabular->getDescentOfRow(i) +
+ tabular->getAscentOfRow(i + 1) +
+ tabular->getAdditionalHeight(i + 1);
}
need_update = NONE;
void InsetTabular::drawCellLines(Painter & pain, int x, int y,
int row, int cell) const
{
- int x2 = x + tabular->GetWidthOfColumn(cell);
+ int x2 = x + tabular->getWidthOfColumn(cell);
bool on_off;
if (!tabular->topAlreadyDrawn(cell)) {
- on_off = !tabular->TopLine(cell);
- pain.line(x, y - tabular->GetAscentOfRow(row),
- x2, y - tabular->GetAscentOfRow(row),
+ on_off = !tabular->topLine(cell);
+ pain.line(x, y - tabular->getAscentOfRow(row),
+ x2, y - tabular->getAscentOfRow(row),
on_off ? LColor::tabularonoffline : LColor::tabularline,
on_off ? Painter::line_onoffdash : Painter::line_solid);
}
- on_off = !tabular->BottomLine(cell);
- pain.line(x, y + tabular->GetDescentOfRow(row),
- x2, y + tabular->GetDescentOfRow(row),
+ on_off = !tabular->bottomLine(cell);
+ pain.line(x, y + tabular->getDescentOfRow(row),
+ x2, y + tabular->getDescentOfRow(row),
on_off ? LColor::tabularonoffline : LColor::tabularline,
on_off ? Painter::line_onoffdash : Painter::line_solid);
if (!tabular->leftAlreadyDrawn(cell)) {
- on_off = !tabular->LeftLine(cell);
- pain.line(x, y - tabular->GetAscentOfRow(row),
- x, y + tabular->GetDescentOfRow(row),
+ on_off = !tabular->leftLine(cell);
+ pain.line(x, y - tabular->getAscentOfRow(row),
+ x, y + tabular->getDescentOfRow(row),
on_off ? LColor::tabularonoffline : LColor::tabularline,
on_off ? Painter::line_onoffdash : Painter::line_solid);
}
- on_off = !tabular->RightLine(cell);
- pain.line(x2 - tabular->GetAdditionalWidth(cell),
- y - tabular->GetAscentOfRow(row),
- x2 - tabular->GetAdditionalWidth(cell),
- y + tabular->GetDescentOfRow(row),
+ on_off = !tabular->rightLine(cell);
+ pain.line(x2 - tabular->getAdditionalWidth(cell),
+ y - tabular->getAscentOfRow(row),
+ x2 - tabular->getAdditionalWidth(cell),
+ y + tabular->getDescentOfRow(row),
on_off ? LColor::tabularonoffline : LColor::tabularline,
on_off ? Painter::line_onoffdash : Painter::line_solid);
}
swap(rs, re);
if ((column >= cs) && (column <= ce) && (row >= rs) && (row <= re)) {
- int w = tabular->GetWidthOfColumn(cell);
- int h = tabular->GetAscentOfRow(row) + tabular->GetDescentOfRow(row)-1;
- pain.fillRectangle(x, y - tabular->GetAscentOfRow(row) + 1,
+ int w = tabular->getWidthOfColumn(cell);
+ int h = tabular->getAscentOfRow(row) + tabular->getDescentOfRow(row)-1;
+ pain.fillRectangle(x, y - tabular->getAscentOfRow(row) + 1,
w, h, LColor::selection);
}
}
if (!inset)
return false;
oldcell = -1;
- if (inset == tabular->GetCellInset(actcell)) {
+ if (inset == tabular->getCellInset(actcell)) {
lyxerr[Debug::INSETTEXT] << "OK" << endl;
- the_locking_inset = tabular->GetCellInset(actcell);
+ the_locking_inset = tabular->getCellInset(actcell);
resetPos(bv);
return true;
} else if (!the_locking_inset) {
- int const n = tabular->GetNumberOfCells();
+ int const n = tabular->getNumberOfCells();
int const id = inset->id();
for (int i = 0; i < n; ++i) {
- InsetText * in = tabular->GetCellInset(i);
+ InsetText * in = tabular->getCellInset(i);
if (inset == in) {
actcell = i;
the_locking_inset = in;
if (inset_hit && bv->theLockingInset()) {
if (!bv->lockInset(static_cast<UpdatableInset*>
- (tabular->GetCellInset(actcell))))
+ (tabular->getCellInset(actcell))))
{
lyxerr[Debug::INSETS] << "Cannot lock inset" << endl;
return;
if (cmd.argument.size()) {
if (cmd.argument == "left") {
if (isRightToLeft(bv))
- actcell = tabular->GetLastCellInRow(0);
+ actcell = tabular->getLastCellInRow(0);
else
actcell = 0;
} else {
if (isRightToLeft(bv))
- actcell = tabular->GetFirstCellInRow(tabular->rows()-1);
+ actcell = tabular->getFirstCellInRow(tabular->rows()-1);
else
- actcell = tabular->GetNumberOfCells() - 1;
+ actcell = tabular->getNumberOfCells() - 1;
}
clearSelection();
resetPos(bv);
// --- Cursor Movements ----------------------------------
case LFUN_RIGHTSEL: {
int const start = hasSelection() ? sel_cell_start : actcell;
- if (tabular->IsLastCellInRow(actcell)) {
+ if (tabular->isLastCellInRow(actcell)) {
setSelection(start, actcell);
break;
}
break;
case LFUN_LEFTSEL: {
int const start = hasSelection() ? sel_cell_start : actcell;
- if (tabular->IsFirstCellInRow(actcell)) {
+ if (tabular->isFirstCellInRow(actcell)) {
setSelection(start, actcell);
break;
}
moveDown(bv, false);
if ((ocell == sel_cell_end) ||
(tabular->column_of_cell(ocell)>tabular->column_of_cell(actcell)))
- setSelection(start, tabular->GetCellBelow(sel_cell_end));
+ setSelection(start, tabular->getCellBelow(sel_cell_end));
else
- setSelection(start, tabular->GetLastCellBelow(sel_cell_end));
+ setSelection(start, tabular->getLastCellBelow(sel_cell_end));
} else {
setSelection(start, start);
}
moveUp(bv, false);
if ((ocell == sel_cell_end) ||
(tabular->column_of_cell(ocell)>tabular->column_of_cell(actcell)))
- setSelection(start, tabular->GetCellAbove(sel_cell_end));
+ setSelection(start, tabular->getCellAbove(sel_cell_end));
else
- setSelection(start, tabular->GetLastCellAbove(sel_cell_end));
+ setSelection(start, tabular->getLastCellAbove(sel_cell_end));
} else {
setSelection(start, start);
}
int column = actcol;
unlockInsetInInset(bv, the_locking_inset);
if (bv->text->top_y() + bv->painter().paperHeight() <
- (top_baseline + tabular->GetHeightOfTabular()))
+ (top_baseline + tabular->getHeightOfTabular()))
{
bv->scrollDocView(bv->text->top_y() + bv->painter().paperHeight());
code = FULL;
- actcell = tabular->GetCellBelow(first_visible_cell) + column;
+ actcell = tabular->getCellBelow(first_visible_cell) + column;
} else {
- actcell = tabular->GetFirstCellInRow(tabular->rows() - 1) + column;
+ actcell = tabular->getFirstCellInRow(tabular->rows() - 1) + column;
}
resetPos(bv);
updateLocal(bv, code);
if (top_baseline > 0)
actcell = column;
else
- actcell = tabular->GetCellBelow(first_visible_cell) + column;
+ actcell = tabular->getCellBelow(first_visible_cell) + column;
} else {
actcell = column;
}
this, rows, maxCols);
string::size_type op = 0;
int cell = 0;
- int cells = paste_tabular->GetNumberOfCells();
+ int cells = paste_tabular->getNumberOfCells();
p = cols = 0;
while ((cell < cells) && (p < len) &&
(p = clip.find_first_of("\t\n", p)) != string::npos) {
break;
switch (clip[p]) {
case '\t':
- paste_tabular->GetCellInset(cell)->setText(clip.substr(op, p-op));
+ paste_tabular->getCellInset(cell)->setText(clip.substr(op, p-op));
++cols;
++cell;
break;
case '\n':
- paste_tabular->GetCellInset(cell)->setText(clip.substr(op, p-op));
+ paste_tabular->getCellInset(cell)->setText(clip.substr(op, p-op));
while (cols++ < maxCols)
++cell;
cols = 0;
}
// check for the last cell if there is no trailing '\n'
if ((cell < cells) && (op < len))
- paste_tabular->GetCellInset(cell)->setText(clip.substr(op, len-op));
+ paste_tabular->getCellInset(cell)->setText(clip.substr(op, len-op));
} else
#else
if (!insertAsciiString(bv, clip, true))
void InsetTabular::validate(LaTeXFeatures & features) const
{
- tabular->Validate(features);
+ tabular->validate(features);
}
// if we have a locking_inset we should have to check only this cell for
// change so I'll try this to have a boost, but who knows ;)
if ((need_update != INIT) &&
- (the_locking_inset == tabular->GetCellInset(actcell))) {
+ (the_locking_inset == tabular->getCellInset(actcell))) {
for(int i = 0; i < tabular->columns(); ++i) {
- maxAsc = max(tabular->GetCellInset(actrow, i)->ascent(bv, font),
+ maxAsc = max(tabular->getCellInset(actrow, i)->ascent(bv, font),
maxAsc);
- maxDesc = max(tabular->GetCellInset(actrow, i)->descent(bv, font),
+ maxDesc = max(tabular->getCellInset(actrow, i)->descent(bv, font),
maxDesc);
}
- changed = tabular->SetWidthOfCell(actcell, the_locking_inset->width(bv, font));
- changed = tabular->SetAscentOfRow(actrow, maxAsc + ADD_TO_HEIGHT) || changed;
- changed = tabular->SetDescentOfRow(actrow, maxDesc + ADD_TO_HEIGHT) || changed;
+ changed = tabular->setWidthOfCell(actcell, the_locking_inset->width(bv, font));
+ changed = tabular->setAscentOfRow(actrow, maxAsc + ADD_TO_HEIGHT) || changed;
+ changed = tabular->setDescentOfRow(actrow, maxDesc + ADD_TO_HEIGHT) || changed;
return changed;
}
for (int i = 0; i < tabular->rows(); ++i) {
maxAsc = 0;
maxDesc = 0;
for (int j = 0; j < tabular->columns(); ++j) {
- if (tabular->IsPartOfMultiColumn(i,j))
+ if (tabular->isPartOfMultiColumn(i,j))
continue;
++cell;
- inset = tabular->GetCellInset(cell);
- if (!reinit && !tabular->GetPWidth(cell).zero())
+ inset = tabular->getCellInset(cell);
+ if (!reinit && !tabular->getPWidth(cell).zero())
inset->update(bv, false);
maxAsc = max(maxAsc, inset->ascent(bv, font));
maxDesc = max(maxDesc, inset->descent(bv, font));
- changed = tabular->SetWidthOfCell(cell, inset->width(bv, font)) || changed;
+ changed = tabular->setWidthOfCell(cell, inset->width(bv, font)) || changed;
}
- changed = tabular->SetAscentOfRow(i, maxAsc + ADD_TO_HEIGHT) || changed;
- changed = tabular->SetDescentOfRow(i, maxDesc + ADD_TO_HEIGHT) || changed;
+ changed = tabular->setAscentOfRow(i, maxAsc + ADD_TO_HEIGHT) || changed;
+ changed = tabular->setDescentOfRow(i, maxDesc + ADD_TO_HEIGHT) || changed;
}
if (changed)
tabular->reinit();
y = cursor_.y() + InsetTabular::y();
// Fun stuff
- int desc = tabular->GetDescentOfRow(actrow);
+ int desc = tabular->getDescentOfRow(actrow);
y += desc;
- int ascdesc = tabular->GetAscentOfRow(actrow) + desc;
+ int ascdesc = tabular->getAscentOfRow(actrow) + desc;
y -= ascdesc / 2;
y += ADD_TO_HEIGHT * 2;
y += TEXT_TO_INSET_OFFSET;
cursor_.y(0);
actcell = actrow = actcol = 0;
- int ly = tabular->GetDescentOfRow(actrow);
+ int ly = tabular->getDescentOfRow(actrow);
// first search the right row
while ((ly < y) && ((actrow+1) < tabular->rows())) {
- cursor_.y(cursor_.y() + tabular->GetDescentOfRow(actrow) +
- tabular->GetAscentOfRow(actrow + 1) +
- tabular->GetAdditionalHeight(actrow + 1));
+ cursor_.y(cursor_.y() + tabular->getDescentOfRow(actrow) +
+ tabular->getAscentOfRow(actrow + 1) +
+ tabular->getAdditionalHeight(actrow + 1));
++actrow;
- ly = cursor_.y() + tabular->GetDescentOfRow(actrow);
+ ly = cursor_.y() + tabular->getDescentOfRow(actrow);
}
- actcell = tabular->GetCellNumber(actrow, actcol);
+ actcell = tabular->getCellNumber(actrow, actcol);
// now search the right column
- int lx = tabular->GetWidthOfColumn(actcell) -
- tabular->GetAdditionalWidth(actcell);
- for (; !tabular->IsLastCellInRow(actcell) && lx < x; ++actcell) {
- lx += tabular->GetWidthOfColumn(actcell + 1)
- + tabular->GetAdditionalWidth(actcell);
+ int lx = tabular->getWidthOfColumn(actcell) -
+ tabular->getAdditionalWidth(actcell);
+ for (; !tabular->isLastCellInRow(actcell) && lx < x; ++actcell) {
+ lx += tabular->getWidthOfColumn(actcell + 1)
+ + tabular->getAdditionalWidth(actcell);
}
- cursor_.x(lx - tabular->GetWidthOfColumn(actcell) + top_x + 2);
+ cursor_.x(lx - tabular->getWidthOfColumn(actcell) + top_x + 2);
resetPos(bv);
}
{
int c = cell;
- for (; !tabular->IsFirstCellInRow(c); --c)
+ for (; !tabular->isFirstCellInRow(c); --c)
;
- int lx = tabular->GetWidthOfColumn(cell);
+ int lx = tabular->getWidthOfColumn(cell);
for (; c < cell; ++c) {
- lx += tabular->GetWidthOfColumn(c);
+ lx += tabular->getWidthOfColumn(c);
}
- return (lx - tabular->GetWidthOfColumn(cell) + top_x);
+ return (lx - tabular->getWidthOfColumn(cell) + top_x);
}
actcol = tabular->column_of_cell(actcell);
actrow = 0;
cursor_.y(0);
- for (; (cell < actcell) && !tabular->IsLastRow(cell); ++cell) {
- if (tabular->IsLastCellInRow(cell)) {
- cursor_.y(cursor_.y() + tabular->GetDescentOfRow(actrow) +
- tabular->GetAscentOfRow(actrow + 1) +
- tabular->GetAdditionalHeight(actrow + 1));
+ for (; (cell < actcell) && !tabular->isLastRow(cell); ++cell) {
+ if (tabular->isLastCellInRow(cell)) {
+ cursor_.y(cursor_.y() + tabular->getDescentOfRow(actrow) +
+ tabular->getAscentOfRow(actrow + 1) +
+ tabular->getAdditionalHeight(actrow + 1));
++actrow;
}
}
cursor_.x(new_x);
// cursor.x(getCellXPos(actcell) + offset);
if ((actcol < tabular->columns() - 1) && scroll(false) &&
- (tabular->GetWidthOfTabular() < bv->workWidth()-20))
+ (tabular->getWidthOfTabular() < bv->workWidth()-20))
{
scroll(bv, 0.0F);
updateLocal(bv, FULL);
} else if (the_locking_inset &&
- (tabular->GetWidthOfColumn(actcell) > bv->workWidth()-20))
+ (tabular->getWidthOfColumn(actcell) > bv->workWidth()-20))
{
int xx = cursor_.x() - offset + bv->text->getRealCursorX();
if (xx > (bv->workWidth()-20)) {
updateLocal(bv, FULL);
}
} else if ((cursor_.x() - offset) > 20 &&
- (cursor_.x() - offset + tabular->GetWidthOfColumn(actcell))
+ (cursor_.x() - offset + tabular->getWidthOfColumn(actcell))
> (bv->workWidth() - 20)) {
- scroll(bv, -tabular->GetWidthOfColumn(actcell) - 20);
+ scroll(bv, -tabular->getWidthOfColumn(actcell) - 20);
updateLocal(bv, FULL);
} else if ((cursor_.x() - offset) < 20) {
scroll(bv, 20 - cursor_.x() + offset);
updateLocal(bv, FULL);
} else if (scroll() && top_x > 20 &&
- (top_x + tabular->GetWidthOfTabular()) > (bv->workWidth() - 20)) {
+ (top_x + tabular->getWidthOfTabular()) > (bv->workWidth() - 20)) {
scroll(bv, old_x - cursor_.x());
updateLocal(bv, FULL);
}
if (the_locking_inset) {
- inset_x = cursor_.x() - top_x + tabular->GetBeginningOfTextInCell(actcell);
+ inset_x = cursor_.x() - top_x + tabular->getBeginningOfTextInCell(actcell);
inset_y = cursor_.y();
}
if ((!the_locking_inset ||
Inset::RESULT InsetTabular::moveUp(BufferView * bv, bool lock)
{
int const ocell = actcell;
- actcell = tabular->GetCellAbove(actcell);
+ actcell = tabular->getCellAbove(actcell);
if (actcell == ocell) // we moved out of the inset
return FINISHED_UP;
resetPos(bv);
int y = 0;
if (old_locking_inset) {
old_locking_inset->getCursorPos(bv, x, y);
- x -= cursor_.x() + tabular->GetBeginningOfTextInCell(actcell);
+ x -= cursor_.x() + tabular->getBeginningOfTextInCell(actcell);
}
if (activateCellInset(bv, x, 0))
return DISPATCHED;
Inset::RESULT InsetTabular::moveDown(BufferView * bv, bool lock)
{
int const ocell = actcell;
- actcell = tabular->GetCellBelow(actcell);
+ actcell = tabular->getCellBelow(actcell);
if (actcell == ocell) // we moved out of the inset
return FINISHED_DOWN;
resetPos(bv);
int y = 0;
if (old_locking_inset) {
old_locking_inset->getCursorPos(bv, x, y);
- x -= cursor_.x() + tabular->GetBeginningOfTextInCell(actcell);
+ x -= cursor_.x() + tabular->getBeginningOfTextInCell(actcell);
}
if (activateCellInset(bv, x, 0))
return DISPATCHED;
bool InsetTabular::moveNextCell(BufferView * bv, bool lock)
{
if (isRightToLeft(bv)) {
- if (tabular->IsFirstCellInRow(actcell)) {
+ if (tabular->isFirstCellInRow(actcell)) {
int row = tabular->row_of_cell(actcell);
if (row == tabular->rows() - 1)
return false;
- actcell = tabular->GetLastCellInRow(row);
- actcell = tabular->GetCellBelow(actcell);
+ actcell = tabular->getLastCellInRow(row);
+ actcell = tabular->getCellBelow(actcell);
} else {
if (!actcell)
return false;
--actcell;
}
} else {
- if (tabular->IsLastCell(actcell))
+ if (tabular->isLastCell(actcell))
return false;
++actcell;
}
if (lock) {
- bool rtl = tabular->GetCellInset(actcell)->paragraphs.begin()->
+ bool rtl = tabular->getCellInset(actcell)->paragraphs.begin()->
isRightToLeftPar(bv->buffer()->params);
activateCellInset(bv, 0, 0, mouse_button::none, !rtl);
}
bool InsetTabular::movePrevCell(BufferView * bv, bool lock)
{
if (isRightToLeft(bv)) {
- if (tabular->IsLastCellInRow(actcell)) {
+ if (tabular->isLastCellInRow(actcell)) {
int row = tabular->row_of_cell(actcell);
if (row == 0)
return false;
- actcell = tabular->GetFirstCellInRow(row);
- actcell = tabular->GetCellAbove(actcell);
+ actcell = tabular->getFirstCellInRow(row);
+ actcell = tabular->getCellAbove(actcell);
} else {
- if (tabular->IsLastCell(actcell))
+ if (tabular->isLastCell(actcell))
return false;
++actcell;
}
--actcell;
}
if (lock) {
- bool rtl = tabular->GetCellInset(actcell)->paragraphs.begin()->
+ bool rtl = tabular->getCellInset(actcell)->paragraphs.begin()->
isRightToLeftPar(bv->buffer()->params);
activateCellInset(bv, 0, 0, mouse_button::none, !rtl);
}
bool selectall)
{
if (selectall) {
- setSelection(0, tabular->GetNumberOfCells() - 1);
+ setSelection(0, tabular->getNumberOfCells() - 1);
}
if (hasSelection()) {
setUndo(bv, Undo::EDIT, bv->text->cursor.par());
getSelection(sel_row_start, sel_row_end, sel_col_start, sel_col_end);
for(int i = sel_row_start; i <= sel_row_end; ++i) {
for(int j = sel_col_start; j <= sel_col_end; ++j) {
- tabular->GetCellInset(i, j)->setFont(bv, font, tall, true);
+ tabular->getCellInset(i, j)->setFont(bv, font, tall, true);
}
}
if (!frozen)
case LyXTabular::SET_PWIDTH:
{
LyXLength const vallen(value);
- LyXLength const & tmplen = tabular->GetColumnPWidth(actcell);
+ LyXLength const & tmplen = tabular->getColumnPWidth(actcell);
bool const update = (tmplen != vallen);
- tabular->SetColumnPWidth(actcell, vallen);
+ tabular->setColumnPWidth(actcell, vallen);
if (update) {
// We need this otherwise we won't resize
// the insettext of the active cell (if any)
int cell;
for (int i = 0; i < tabular->rows(); ++i) {
- cell = tabular->GetCellNumber(i,column);
- tabular->GetCellInset(cell)->resizeLyXText(bv);
+ cell = tabular->getCellNumber(i,column);
+ tabular->getCellInset(cell)->resizeLyXText(bv);
}
updateLocal(bv, INIT);
}
if (vallen.zero()
- && tabular->GetAlignment(actcell, true) == LYX_ALIGN_BLOCK)
+ && tabular->getAlignment(actcell, true) == LYX_ALIGN_BLOCK)
tabularFeatures(bv, LyXTabular::ALIGN_CENTER, string());
else if (!vallen.zero()
- && tabular->GetAlignment(actcell, true) != LYX_ALIGN_BLOCK)
+ && tabular->getAlignment(actcell, true) != LYX_ALIGN_BLOCK)
tabularFeatures(bv, LyXTabular::ALIGN_BLOCK, string());
}
break;
case LyXTabular::SET_MPWIDTH:
{
LyXLength const vallen(value);
- LyXLength const & tmplen = tabular->GetPWidth(actcell);
+ LyXLength const & tmplen = tabular->getPWidth(actcell);
bool const update = (tmplen != vallen);
- tabular->SetMColumnPWidth(actcell, vallen);
+ tabular->setMColumnPWidth(actcell, vallen);
if (update) {
// We need this otherwise we won't resize
// the insettext of the active cell (if any)
unlockInsetInInset(bv, the_locking_inset);
for (int i = 0; i < tabular->rows(); ++i) {
- tabular->GetCellInset(tabular->GetCellNumber(i, column))->
+ tabular->getCellInset(tabular->getCellNumber(i, column))->
resizeLyXText(bv);
}
updateLocal(bv, INIT);
break;
case LyXTabular::SET_SPECIAL_COLUMN:
case LyXTabular::SET_SPECIAL_MULTI:
- tabular->SetAlignSpecial(actcell,value,feature);
+ tabular->setAlignSpecial(actcell,value,feature);
updateLocal(bv, FULL);
break;
case LyXTabular::APPEND_ROW:
// append the row into the tabular
unlockInsetInInset(bv, the_locking_inset);
- tabular->AppendRow(bv->buffer()->params, actcell);
+ tabular->appendRow(bv->buffer()->params, actcell);
updateLocal(bv, INIT);
break;
case LyXTabular::APPEND_COLUMN:
// append the column into the tabular
unlockInsetInInset(bv, the_locking_inset);
- tabular->AppendColumn(bv->buffer()->params, actcell);
- actcell = tabular->GetCellNumber(row, column);
+ tabular->appendColumn(bv->buffer()->params, actcell);
+ actcell = tabular->getCellNumber(row, column);
updateLocal(bv, INIT);
break;
case LyXTabular::DELETE_ROW:
unlockInsetInInset(bv, the_locking_inset);
for(int i = sel_row_start; i <= sel_row_end; ++i) {
- tabular->DeleteRow(sel_row_start);
+ tabular->deleteRow(sel_row_start);
}
if (sel_row_start >= tabular->rows())
--sel_row_start;
- actcell = tabular->GetCellNumber(sel_row_start, column);
+ actcell = tabular->getCellNumber(sel_row_start, column);
clearSelection();
updateLocal(bv, INIT);
break;
case LyXTabular::DELETE_COLUMN:
unlockInsetInInset(bv, the_locking_inset);
for(int i = sel_col_start; i <= sel_col_end; ++i) {
- tabular->DeleteColumn(sel_col_start);
+ tabular->deleteColumn(sel_col_start);
}
if (sel_col_start >= tabular->columns())
--sel_col_start;
- actcell = tabular->GetCellNumber(row, sel_col_start);
+ actcell = tabular->getCellNumber(row, sel_col_start);
clearSelection();
updateLocal(bv, INIT);
break;
flag = false;
case LyXTabular::TOGGLE_LINE_TOP:
{
- bool lineSet = !tabular->TopLine(actcell, flag);
+ bool lineSet = !tabular->topLine(actcell, flag);
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetTopLine(
- tabular->GetCellNumber(i, j),
+ tabular->setTopLine(
+ tabular->getCellNumber(i, j),
lineSet, flag);
updateLocal(bv, INIT);
break;
flag = false;
case LyXTabular::TOGGLE_LINE_BOTTOM:
{
- bool lineSet = !tabular->BottomLine(actcell, flag);
+ bool lineSet = !tabular->bottomLine(actcell, flag);
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetBottomLine(
- tabular->GetCellNumber(i, j),
+ tabular->setBottomLine(
+ tabular->getCellNumber(i, j),
lineSet,
flag);
updateLocal(bv, INIT);
flag = false;
case LyXTabular::TOGGLE_LINE_LEFT:
{
- bool lineSet = !tabular->LeftLine(actcell, flag);
+ bool lineSet = !tabular->leftLine(actcell, flag);
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetLeftLine(
- tabular->GetCellNumber(i,j),
+ tabular->setLeftLine(
+ tabular->getCellNumber(i,j),
lineSet,
flag);
updateLocal(bv, INIT);
flag = false;
case LyXTabular::TOGGLE_LINE_RIGHT:
{
- bool lineSet = !tabular->RightLine(actcell, flag);
+ bool lineSet = !tabular->rightLine(actcell, flag);
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetRightLine(
- tabular->GetCellNumber(i,j),
+ tabular->setRightLine(
+ tabular->getCellNumber(i,j),
lineSet,
flag);
updateLocal(bv, INIT);
case LyXTabular::ALIGN_BLOCK:
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetAlignment(
- tabular->GetCellNumber(i, j),
+ tabular->setAlignment(
+ tabular->getCellNumber(i, j),
setAlign,
flag);
updateLocal(bv, INIT);
case LyXTabular::VALIGN_CENTER:
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetVAlignment(
- tabular->GetCellNumber(i, j),
+ tabular->setVAlignment(
+ tabular->getCellNumber(i, j),
setVAlign, flag);
updateLocal(bv, INIT);
break;
// just multicol for one Single Cell
if (!hasSelection()) {
// check wether we are completly in a multicol
- if (tabular->IsMultiColumn(actcell)) {
- tabular->UnsetMultiColumn(actcell);
+ if (tabular->isMultiColumn(actcell)) {
+ tabular->unsetMultiColumn(actcell);
updateLocal(bv, INIT);
} else {
- tabular->SetMultiColumn(bv->buffer(), actcell, 1);
+ tabular->setMultiColumn(bv->buffer(), actcell, 1);
updateLocal(bv, CELL);
}
break;
s_start = sel_cell_start;
s_end = sel_cell_end;
}
- tabular->SetMultiColumn(bv->buffer(), s_start, s_end - s_start + 1);
+ tabular->setMultiColumn(bv->buffer(), s_start, s_end - s_start + 1);
actcell = s_start;
clearSelection();
updateLocal(bv, INIT);
case LyXTabular::UNSET_ALL_LINES:
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetAllLines(
- tabular->GetCellNumber(i,j), setLines);
+ tabular->setAllLines(
+ tabular->getCellNumber(i,j), setLines);
updateLocal(bv, INIT);
break;
case LyXTabular::SET_LONGTABULAR:
- tabular->SetLongTabular(true);
+ tabular->setLongTabular(true);
updateLocal(bv, INIT); // because this toggles displayed
break;
case LyXTabular::UNSET_LONGTABULAR:
- tabular->SetLongTabular(false);
+ tabular->setLongTabular(false);
updateLocal(bv, INIT); // because this toggles displayed
break;
case LyXTabular::SET_ROTATE_TABULAR:
- tabular->SetRotateTabular(true);
+ tabular->setRotateTabular(true);
break;
case LyXTabular::UNSET_ROTATE_TABULAR:
- tabular->SetRotateTabular(false);
+ tabular->setRotateTabular(false);
break;
case LyXTabular::SET_ROTATE_CELL:
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j<=sel_col_end; ++j)
- tabular->SetRotateCell(
- tabular->GetCellNumber(i, j),
+ tabular->setRotateCell(
+ tabular->getCellNumber(i, j),
true);
break;
case LyXTabular::UNSET_ROTATE_CELL:
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetRotateCell(
- tabular->GetCellNumber(i, j), false);
+ tabular->setRotateCell(
+ tabular->getCellNumber(i, j), false);
break;
case LyXTabular::SET_USEBOX:
{
LyXTabular::BoxType val = LyXTabular::BoxType(strToInt(value));
- if (val == tabular->GetUsebox(actcell))
+ if (val == tabular->getUsebox(actcell))
val = LyXTabular::BOX_NONE;
for (int i = sel_row_start; i <= sel_row_end; ++i)
for (int j = sel_col_start; j <= sel_col_end; ++j)
- tabular->SetUsebox(
- tabular->GetCellNumber(i, j), val);
+ tabular->setUsebox(
+ tabular->getCellNumber(i, j), val);
break;
}
case LyXTabular::UNSET_LTFIRSTHEAD:
flag = false;
case LyXTabular::SET_LTFIRSTHEAD:
- (void)tabular->GetRowOfLTFirstHead(row, ltt);
+ (void)tabular->getRowOfLTFirstHead(row, ltt);
checkLongtableSpecial(ltt, value, flag);
- tabular->SetLTHead(row, flag, ltt, true);
+ tabular->setLTHead(row, flag, ltt, true);
break;
case LyXTabular::UNSET_LTHEAD:
flag = false;
case LyXTabular::SET_LTHEAD:
- (void)tabular->GetRowOfLTHead(row, ltt);
+ (void)tabular->getRowOfLTHead(row, ltt);
checkLongtableSpecial(ltt, value, flag);
- tabular->SetLTHead(row, flag, ltt, false);
+ tabular->setLTHead(row, flag, ltt, false);
break;
case LyXTabular::UNSET_LTFOOT:
flag = false;
case LyXTabular::SET_LTFOOT:
- (void)tabular->GetRowOfLTFoot(row, ltt);
+ (void)tabular->getRowOfLTFoot(row, ltt);
checkLongtableSpecial(ltt, value, flag);
- tabular->SetLTFoot(row, flag, ltt, false);
+ tabular->setLTFoot(row, flag, ltt, false);
break;
case LyXTabular::UNSET_LTLASTFOOT:
flag = false;
case LyXTabular::SET_LTLASTFOOT:
- (void)tabular->GetRowOfLTLastFoot(row, ltt);
+ (void)tabular->getRowOfLTLastFoot(row, ltt);
checkLongtableSpecial(ltt, value, flag);
- tabular->SetLTFoot(row, flag, ltt, true);
+ tabular->setLTFoot(row, flag, ltt, true);
break;
case LyXTabular::SET_LTNEWPAGE:
{
- bool what = !tabular->GetLTNewPage(row);
- tabular->SetLTNewPage(row, what);
+ bool what = !tabular->getLTNewPage(row);
+ tabular->setLTNewPage(row, what);
break;
}
// dummy stuff just to avoid warnings
bool behind)
{
UpdatableInset * inset =
- static_cast<UpdatableInset*>(tabular->GetCellInset(actcell));
+ static_cast<UpdatableInset*>(tabular->getCellInset(actcell));
LyXFont font(LyXFont::ALL_SANE);
if (behind) {
x = inset->x() + inset->width(bv, font);
y = inset->descent(bv, font);
}
- //inset_x = cursor.x() - top_x + tabular->GetBeginningOfTextInCell(actcell);
+ //inset_x = cursor.x() - top_x + tabular->getBeginningOfTextInCell(actcell);
//inset_y = cursor.y();
inset->localDispatch(FuncRequest(bv, LFUN_INSET_EDIT, x, y, button));
if (!the_locking_inset)
mouse_button::state button)
{
inset_x = cursor_.x()
- - top_x + tabular->GetBeginningOfTextInCell(actcell);
+ - top_x + tabular->getBeginningOfTextInCell(actcell);
inset_y = cursor_.y();
return activateCellInset(bv, x - inset_x, y - inset_y, button);
}
bool InsetTabular::insetHit(BufferView *, int x, int) const
{
return (x + top_x)
- > (cursor_.x() + tabular->GetBeginningOfTextInCell(actcell));
+ > (cursor_.x() + tabular->getBeginningOfTextInCell(actcell));
}
// in pixels if we have a pwidth for this cell.
int InsetTabular::getMaxWidthOfCell(BufferView * bv, int cell) const
{
- LyXLength const len = tabular->GetPWidth(cell);
+ LyXLength const len = tabular->getPWidth(cell);
if (len.zero())
return -1;
int InsetTabular::getMaxWidth(BufferView * bv,
UpdatableInset const * inset) const
{
- int cell = tabular->GetCellFromInset(inset, actcell);
+ int cell = tabular->getCellFromInset(inset, actcell);
if (cell == -1) {
lyxerr << "Own inset not found, shouldn't really happen!"
if (force) {
for(int i = 0; i < tabular->rows(); ++i) {
for(int j = 0; j < tabular->columns(); ++j) {
- tabular->GetCellInset(i, j)->resizeLyXText(bv, true);
+ tabular->getCellInset(i, j)->resizeLyXText(bv, true);
}
}
}
// if we're locked lock the actual insettext and return it's LyXText!!!
if (locked) {
UpdatableInset * inset =
- static_cast<UpdatableInset*>(tabular->GetCellInset(actcell));
+ static_cast<UpdatableInset*>(tabular->getCellInset(actcell));
inset->edit(const_cast<BufferView *>(bv), 0, 0, 0);
return the_locking_inset->getLyXText(bv, recursive);
}
return status.clear();
case LyXTabular::MULTICOLUMN:
- status.setOnOff(tabular->IsMultiColumn(actcell));
+ status.setOnOff(tabular->isMultiColumn(actcell));
break;
case LyXTabular::M_TOGGLE_LINE_TOP:
flag = false;
case LyXTabular::TOGGLE_LINE_TOP:
- status.setOnOff(tabular->TopLine(actcell, flag));
+ status.setOnOff(tabular->topLine(actcell, flag));
break;
case LyXTabular::M_TOGGLE_LINE_BOTTOM:
flag = false;
case LyXTabular::TOGGLE_LINE_BOTTOM:
- status.setOnOff(tabular->BottomLine(actcell, flag));
+ status.setOnOff(tabular->bottomLine(actcell, flag));
break;
case LyXTabular::M_TOGGLE_LINE_LEFT:
flag = false;
case LyXTabular::TOGGLE_LINE_LEFT:
- status.setOnOff(tabular->LeftLine(actcell, flag));
+ status.setOnOff(tabular->leftLine(actcell, flag));
break;
case LyXTabular::M_TOGGLE_LINE_RIGHT:
flag = false;
case LyXTabular::TOGGLE_LINE_RIGHT:
- status.setOnOff(tabular->RightLine(actcell, flag));
+ status.setOnOff(tabular->rightLine(actcell, flag));
break;
case LyXTabular::M_ALIGN_LEFT:
flag = false;
case LyXTabular::ALIGN_LEFT:
- status.setOnOff(tabular->GetAlignment(actcell, flag) == LYX_ALIGN_LEFT);
+ status.setOnOff(tabular->getAlignment(actcell, flag) == LYX_ALIGN_LEFT);
break;
case LyXTabular::M_ALIGN_RIGHT:
flag = false;
case LyXTabular::ALIGN_RIGHT:
- status.setOnOff(tabular->GetAlignment(actcell, flag) == LYX_ALIGN_RIGHT);
+ status.setOnOff(tabular->getAlignment(actcell, flag) == LYX_ALIGN_RIGHT);
break;
case LyXTabular::M_ALIGN_CENTER:
flag = false;
case LyXTabular::ALIGN_CENTER:
- status.setOnOff(tabular->GetAlignment(actcell, flag) == LYX_ALIGN_CENTER);
+ status.setOnOff(tabular->getAlignment(actcell, flag) == LYX_ALIGN_CENTER);
break;
case LyXTabular::ALIGN_BLOCK:
- status.disabled(tabular->GetPWidth(actcell).zero());
- status.setOnOff(tabular->GetAlignment(actcell, flag) == LYX_ALIGN_BLOCK);
+ status.disabled(tabular->getPWidth(actcell).zero());
+ status.setOnOff(tabular->getAlignment(actcell, flag) == LYX_ALIGN_BLOCK);
break;
case LyXTabular::M_VALIGN_TOP:
flag = false;
case LyXTabular::VALIGN_TOP:
- status.setOnOff(tabular->GetVAlignment(actcell, flag) == LyXTabular::LYX_VALIGN_TOP);
+ status.setOnOff(tabular->getVAlignment(actcell, flag) == LyXTabular::LYX_VALIGN_TOP);
break;
case LyXTabular::M_VALIGN_BOTTOM:
flag = false;
case LyXTabular::VALIGN_BOTTOM:
- status.setOnOff(tabular->GetVAlignment(actcell, flag) == LyXTabular::LYX_VALIGN_BOTTOM);
+ status.setOnOff(tabular->getVAlignment(actcell, flag) == LyXTabular::LYX_VALIGN_BOTTOM);
break;
case LyXTabular::M_VALIGN_CENTER:
flag = false;
case LyXTabular::VALIGN_CENTER:
- status.setOnOff(tabular->GetVAlignment(actcell, flag) == LyXTabular::LYX_VALIGN_CENTER);
+ status.setOnOff(tabular->getVAlignment(actcell, flag) == LyXTabular::LYX_VALIGN_CENTER);
break;
case LyXTabular::SET_LONGTABULAR:
- status.setOnOff(tabular->IsLongTabular());
+ status.setOnOff(tabular->isLongTabular());
break;
case LyXTabular::UNSET_LONGTABULAR:
- status.setOnOff(!tabular->IsLongTabular());
+ status.setOnOff(!tabular->isLongTabular());
break;
case LyXTabular::SET_ROTATE_TABULAR:
- status.setOnOff(tabular->GetRotateTabular());
+ status.setOnOff(tabular->getRotateTabular());
break;
case LyXTabular::UNSET_ROTATE_TABULAR:
- status.setOnOff(!tabular->GetRotateTabular());
+ status.setOnOff(!tabular->getRotateTabular());
break;
case LyXTabular::SET_ROTATE_CELL:
- status.setOnOff(tabular->GetRotateCell(actcell));
+ status.setOnOff(tabular->getRotateCell(actcell));
break;
case LyXTabular::UNSET_ROTATE_CELL:
- status.setOnOff(!tabular->GetRotateCell(actcell));
+ status.setOnOff(!tabular->getRotateCell(actcell));
break;
case LyXTabular::SET_USEBOX:
- status.setOnOff(strToInt(argument) == tabular->GetUsebox(actcell));
+ status.setOnOff(strToInt(argument) == tabular->getUsebox(actcell));
break;
case LyXTabular::SET_LTFIRSTHEAD:
- status.setOnOff(tabular->GetRowOfLTHead(sel_row_start, dummyltt));
+ status.setOnOff(tabular->getRowOfLTHead(sel_row_start, dummyltt));
break;
case LyXTabular::SET_LTHEAD:
- status.setOnOff(tabular->GetRowOfLTHead(sel_row_start, dummyltt));
+ status.setOnOff(tabular->getRowOfLTHead(sel_row_start, dummyltt));
break;
case LyXTabular::SET_LTFOOT:
- status.setOnOff(tabular->GetRowOfLTFoot(sel_row_start, dummyltt));
+ status.setOnOff(tabular->getRowOfLTFoot(sel_row_start, dummyltt));
break;
case LyXTabular::SET_LTLASTFOOT:
- status.setOnOff(tabular->GetRowOfLTFoot(sel_row_start, dummyltt));
+ status.setOnOff(tabular->getRowOfLTFoot(sel_row_start, dummyltt));
break;
case LyXTabular::SET_LTNEWPAGE:
- status.setOnOff(tabular->GetLTNewPage(sel_row_start));
+ status.setOnOff(tabular->getLTNewPage(sel_row_start));
break;
default:
status.clear();
paste_tabular = new LyXTabular(bv->buffer()->params,
this, *tabular); // rows, columns);
for (int i = 0; i < sel_row_start; ++i)
- paste_tabular->DeleteRow(0);
+ paste_tabular->deleteRow(0);
while (paste_tabular->rows() > rows)
- paste_tabular->DeleteRow(rows);
- paste_tabular->SetTopLine(0, true, true);
- paste_tabular->SetBottomLine(paste_tabular->GetFirstCellInRow(rows - 1),
+ paste_tabular->deleteRow(rows);
+ paste_tabular->setTopLine(0, true, true);
+ paste_tabular->setBottomLine(paste_tabular->getFirstCellInRow(rows - 1),
true, true);
for (int i = 0; i < sel_col_start; ++i)
- paste_tabular->DeleteColumn(0);
+ paste_tabular->deleteColumn(0);
while (paste_tabular->columns() > columns)
- paste_tabular->DeleteColumn(columns);
- paste_tabular->SetLeftLine(0, true, true);
- paste_tabular->SetRightLine(paste_tabular->GetLastCellInRow(0),
+ paste_tabular->deleteColumn(columns);
+ paste_tabular->setLeftLine(0, true, true);
+ paste_tabular->setRightLine(paste_tabular->getLastCellInRow(0),
true, true);
ostringstream sstr;
for(int c1 = 0, c2 = actcol;
(c1 < paste_tabular->columns()) && (c2 < tabular->columns());
++c1, ++c2) {
- if (paste_tabular->IsPartOfMultiColumn(r1,c1) &&
- tabular->IsPartOfMultiColumn(r2,c2))
+ if (paste_tabular->isPartOfMultiColumn(r1,c1) &&
+ tabular->isPartOfMultiColumn(r2,c2))
continue;
- if (paste_tabular->IsPartOfMultiColumn(r1,c1)) {
+ if (paste_tabular->isPartOfMultiColumn(r1,c1)) {
--c2;
continue;
}
- if (tabular->IsPartOfMultiColumn(r2,c2)) {
+ if (tabular->isPartOfMultiColumn(r2,c2)) {
--c1;
continue;
}
- int const n1 = paste_tabular->GetCellNumber(r1, c1);
- int const n2 = tabular->GetCellNumber(r2, c2);
- *(tabular->GetCellInset(n2)) = *(paste_tabular->GetCellInset(n1));
- tabular->GetCellInset(n2)->setOwner(this);
- tabular->GetCellInset(n2)->deleteLyXText(bv);
- tabular->GetCellInset(n2)->markNew();
+ int const n1 = paste_tabular->getCellNumber(r1, c1);
+ int const n2 = tabular->getCellNumber(r2, c2);
+ *(tabular->getCellInset(n2)) = *(paste_tabular->getCellInset(n1));
+ tabular->getCellInset(n2)->setOwner(this);
+ tabular->getCellInset(n2)->deleteLyXText(bv);
+ tabular->getCellInset(n2)->markNew();
}
}
return true;
}
for (int i = sel_row_start; i <= sel_row_end; ++i) {
for (int j = sel_col_start; j <= sel_col_end; ++j) {
- tabular->GetCellInset(tabular->GetCellNumber(i, j))->clear(bp.tracking_changes);
+ tabular->getCellInset(tabular->getCellNumber(i, j))->clear(bp.tracking_changes);
}
}
return true;
ParagraphList * InsetTabular::getParagraphs(int i) const
{
- return (i < tabular->GetNumberOfCells())
- ? tabular->GetCellInset(i)->getParagraphs(0)
+ return (i < tabular->getNumberOfCells())
+ ? tabular->getCellInset(i)->getParagraphs(0)
: 0;
}
Inset * result;
for(int i = 0; i < tabular->rows(); ++i) {
for(int j = 0; j < tabular->columns(); ++j) {
- if ((result = tabular->GetCellInset(i, j)->getInsetFromID(id_arg)))
+ if ((result = tabular->getCellInset(i, j)->getInsetFromID(id_arg)))
return result;
}
}
nodraw(false);
return word;
}
- if (tabular->IsLastCell(actcell)) {
+ if (tabular->isLastCell(actcell)) {
bv->unlockInset(const_cast<InsetTabular *>(this));
nodraw(false);
return WordLangTuple();
}
// otherwise we have to lock the next inset and ask for it's selecttion
UpdatableInset * inset =
- static_cast<UpdatableInset*>(tabular->GetCellInset(actcell));
+ static_cast<UpdatableInset*>(tabular->getCellInset(actcell));
inset->localDispatch(FuncRequest(bv, LFUN_INSET_EDIT));
WordLangTuple word(selectNextWordInt(bv, value));
nodraw(false);
if (!word.word().empty())
return word;
- if (tabular->IsLastCell(actcell)) {
+ if (tabular->isLastCell(actcell)) {
bv->unlockInset(const_cast<InsetTabular *>(this));
return WordLangTuple();
}
// otherwise we have to lock the next inset and ask for it's selecttion
UpdatableInset * inset =
- static_cast<UpdatableInset*>(tabular->GetCellInset(++actcell));
+ static_cast<UpdatableInset*>(tabular->getCellInset(++actcell));
inset->localDispatch(FuncRequest(bv, LFUN_INSET_EDIT));
return selectNextWordInt(bv, value);
}
{
int cell = 0;
- while (cell < tabular->GetNumberOfCells()) {
- InsetText * inset = tabular->GetCellInset(cell);
+ while (cell < tabular->getNumberOfCells()) {
+ InsetText * inset = tabular->getCellInset(cell);
inset->markErased();
++cell;
}
updateLocal(bv, CELL);
return true;
}
- if (tabular->IsLastCell(actcell))
+ if (tabular->isLastCell(actcell))
return false;
++actcell;
}
- InsetText * inset = tabular->GetCellInset(actcell);
+ InsetText * inset = tabular->getCellInset(actcell);
if (inset->nextChange(bv, length)) {
updateLocal(bv, FULL);
return true;
}
- while (!tabular->IsLastCell(actcell)) {
+ while (!tabular->isLastCell(actcell)) {
++actcell;
- inset = tabular->GetCellInset(actcell);
+ inset = tabular->getCellInset(actcell);
if (inset->nextChange(bv, length)) {
updateLocal(bv, FULL);
return true;
updateLocal(bv, CELL);
return true;
}
- if (tabular->IsLastCell(actcell))
+ if (tabular->isLastCell(actcell))
return false;
cell = actcell + 1;
}
- InsetText * inset = tabular->GetCellInset(cell);
+ InsetText * inset = tabular->getCellInset(cell);
if (inset->searchForward(bv, str, cs, mw)) {
updateLocal(bv, FULL);
return true;
}
- while (!tabular->IsLastCell(cell)) {
+ while (!tabular->isLastCell(cell)) {
++cell;
- inset = tabular->GetCellInset(cell);
+ inset = tabular->getCellInset(cell);
if (inset->searchForward(bv, str, cs, mw)) {
updateLocal(bv, FULL);
return true;
bool InsetTabular::searchBackward(BufferView * bv, string const & str,
bool cs, bool mw)
{
- int cell = tabular->GetNumberOfCells();
+ int cell = tabular->getNumberOfCells();
if (the_locking_inset) {
if (the_locking_inset->searchBackward(bv, str, cs, mw)) {
updateLocal(bv, CELL);
while (cell) {
--cell;
- InsetText * inset = tabular->GetCellInset(cell);
+ InsetText * inset = tabular->getCellInset(cell);
if (inset->searchBackward(bv, str, cs, mw)) {
updateLocal(bv, CELL);
return true;
bool InsetTabular::forceDefaultParagraphs(Inset const * in) const
{
- const int cell = tabular->GetCellFromInset(in, actcell);
+ const int cell = tabular->getCellFromInset(in, actcell);
if (cell != -1)
- return tabular->GetPWidth(cell).zero();
+ return tabular->getPWidth(cell).zero();
// well we didn't obviously find it so maybe our owner knows more
if (owner())
}
string::size_type op = 0;
- int cells = loctab->GetNumberOfCells();
+ int cells = loctab->getNumberOfCells();
p = 0;
cols = ocol;
rows = loctab->rows();
case '\t':
// we can only set this if we are not too far right
if (cols < columns) {
- InsetText * ti = loctab->GetCellInset(cell);
+ InsetText * ti = loctab->getCellInset(cell);
LyXFont const font = ti->getLyXText(bv)->
getFont(bv->buffer(), ti->paragraphs.begin(), 0);
ti->setText(buf.substr(op, p - op), font);
case '\n':
// we can only set this if we are not too far right
if (cols < columns) {
- InsetText * ti = loctab->GetCellInset(cell);
+ InsetText * ti = loctab->getCellInset(cell);
LyXFont const font = ti->getLyXText(bv)->
getFont(bv->buffer(), ti->paragraphs.begin(), 0);
ti->setText(buf.substr(op, p - op), font);
cols = ocol;
++row;
if (row < rows)
- cell = loctab->GetCellNumber(row, cols);
+ cell = loctab->getCellNumber(row, cols);
break;
}
++p;
}
// check for the last cell if there is no trailing '\n'
if ((cell < cells) && (op < len)) {
- InsetText * ti = loctab->GetCellInset(cell);
+ InsetText * ti = loctab->getCellInset(cell);
LyXFont const font = ti->getLyXText(bv)->
getFont(bv->buffer(), ti->paragraphs.begin(), 0);
ti->setText(buf.substr(op, len - op), font);
int const columns = tabular->columns();
for (int i = 0; i < rows; ++i) {
for (int j = 0; j < columns; ++j) {
- tabular->GetCellInset(i,j)->addPreview(loader);
+ tabular->getCellInset(i,j)->addPreview(loader);
}
}
}
insets that may contain several paragraphs */
bool noFontChange() const { return true; }
///
- bool display() const { return tabular->IsLongTabular(); }
+ bool display() const { return tabular->isLongTabular(); }
///
RESULT localDispatch(FuncRequest const &);
///
}
-/* konstruktor */
LyXTabular::LyXTabular(BufferParams const & bp,
InsetTabular * inset, int rows_arg, int columns_arg)
{
owner_ = inset;
cur_cell = -1;
- Init(bp, rows_arg, columns_arg);
+ init(bp, rows_arg, columns_arg);
}
{
owner_ = inset;
cur_cell = -1;
- Init(bp, lt.rows_, lt.columns_, <);
+ init(bp, lt.rows_, lt.columns_, <);
#if 0
#ifdef WITH_WARNINGS
#warning Jürgen, can you make it the other way round. So that copy assignment depends on the copy constructor and not the other way. (Lgb)
{
owner_ = inset;
cur_cell = -1;
- Read(buf, lex);
+ read(buf, lex);
}
cell_info = lt.cell_info;
row_info = lt.row_info;
column_info = lt.column_info;
- SetLongTabular(lt.is_long_tabular);
+ setLongTabular(lt.is_long_tabular);
rotate = lt.rotate;
Reinit();
}
-/* activates all lines and sets all widths to 0 */
-void LyXTabular::Init(BufferParams const & bp,
+// activates all lines and sets all widths to 0
+void LyXTabular::init(BufferParams const & bp,
int rows_arg, int columns_arg, LyXTabular const * lt)
{
rows_ = rows_arg;
}
-void LyXTabular::AppendRow(BufferParams const & bp, int cell)
+void LyXTabular::appendRow(BufferParams const & bp, int cell)
{
++rows_;
}
-void LyXTabular::DeleteRow(int row)
+void LyXTabular::deleteRow(int row)
{
if (rows_ == 1) return; // Not allowed to delete last row
}
-void LyXTabular::AppendColumn(BufferParams const & bp, int cell)
+void LyXTabular::appendColumn(BufferParams const & bp, int cell)
{
++columns_;
}
-void LyXTabular::DeleteColumn(int column)
+void LyXTabular::deleteColumn(int column)
{
- // Similar to DeleteRow
+ // Similar to deleteRow
//if (!(columns_ - 1))
//return;
if (columns_ == 1) return; // Not allowed to delete last column
for (int row = 0; row < rows_; ++row) {
for (int column = 0; column < columns_; ++column) {
- if (IsPartOfMultiColumn(row,column))
+ if (isPartOfMultiColumn(row,column))
continue;
// now set the right line of multicolumns right for oldformat read
if (oldformat &&
cell_info[row][column+cn-1].right_line;
}
cell_info[row][column].inset.setAutoBreakRows(
- !GetPWidth(GetCellNumber(row, column)).zero());
+ !getPWidth(getCellNumber(row, column)).zero());
}
}
}
-int LyXTabular::GetNumberOfCells() const
+int LyXTabular::getNumberOfCells() const
{
return numberofcells;
}
-int LyXTabular::NumberOfCellsInRow(int cell) const
+int LyXTabular::numberOfCellsInRow(int cell) const
{
int const row = row_of_cell(cell);
int result = 0;
}
-/* returns 1 if there is a topline, returns 0 if not */
-bool LyXTabular::TopLine(int cell, bool onlycolumn) const
+// returns 1 if there is a topline, returns 0 if not
+bool LyXTabular::topLine(int cell, bool onlycolumn) const
{
int const row = row_of_cell(cell);
- if (!onlycolumn && IsMultiColumn(cell))
+ if (!onlycolumn && isMultiColumn(cell))
return cellinfo_of_cell(cell)->top_line;
return row_info[row].top_line;
}
-bool LyXTabular::BottomLine(int cell, bool onlycolumn) const
+bool LyXTabular::bottomLine(int cell, bool onlycolumn) const
{
// no bottom line underneath non-existent cells if you please
// Isn't that a programming error? Is so this should
if (cell >= numberofcells)
return false;
- if (!onlycolumn && IsMultiColumn(cell))
+ if (!onlycolumn && isMultiColumn(cell))
return cellinfo_of_cell(cell)->bottom_line;
return row_info[row_of_cell(cell)].bottom_line;
}
-bool LyXTabular::LeftLine(int cell, bool onlycolumn) const
+bool LyXTabular::leftLine(int cell, bool onlycolumn) const
{
- if (!onlycolumn && IsMultiColumn(cell) &&
- (IsFirstCellInRow(cell) || IsMultiColumn(cell-1)))
+ if (!onlycolumn && isMultiColumn(cell) &&
+ (isFirstCellInRow(cell) || isMultiColumn(cell-1)))
{
#ifdef SPECIAL_COLUM_HANDLING
if (cellinfo_of_cell(cell)->align_special.empty())
}
-bool LyXTabular::RightLine(int cell, bool onlycolumn) const
+bool LyXTabular::rightLine(int cell, bool onlycolumn) const
{
- if (!onlycolumn && IsMultiColumn(cell) &&
- (IsLastCellInRow(cell) || IsMultiColumn(cell+1)))
+ if (!onlycolumn && isMultiColumn(cell) &&
+ (isLastCellInRow(cell) || isMultiColumn(cell+1)))
{
#ifdef SPECIAL_COLUM_HANDLING
if (cellinfo_of_cell(cell)->align_special.empty())
bool LyXTabular::topAlreadyDrawn(int cell) const
{
int row = row_of_cell(cell);
- if ((row > 0) && !GetAdditionalHeight(row)) {
+ if ((row > 0) && !getAdditionalHeight(row)) {
int column = column_of_cell(cell);
--row;
while (column
while (--column &&
(cell_info[row][column].multicolumn ==
LyXTabular::CELL_PART_OF_MULTICOLUMN));
- if (GetAdditionalWidth(cell_info[row][column].cellno))
+ if (getAdditionalWidth(cell_info[row][column].cellno))
return false;
#ifdef SPECIAL_COLUM_HANDLING
- return RightLine(cell_info[row][column].cellno);
+ return rightLine(cell_info[row][column].cellno);
#else
- return RightLine(cell_info[row][column].cellno, true);
+ return rightLine(cell_info[row][column].cellno, true);
#endif
}
return false;
}
-bool LyXTabular::IsLastRow(int cell) const
+bool LyXTabular::isLastRow(int cell) const
{
return (row_of_cell(cell) == rows_ - 1);
}
-int LyXTabular::GetAdditionalHeight(int row) const
+int LyXTabular::getAdditionalHeight(int row) const
{
if (!row || row >= rows_)
return 0;
}
-int LyXTabular::GetAdditionalWidth(int cell) const
+int LyXTabular::getAdditionalWidth(int cell) const
{
- // internally already set in SetWidthOfCell
+ // internally already set in setWidthOfCell
// used to get it back in text.C
int const col = right_column_of_cell(cell);
int const row = row_of_cell(cell);
- if (col < columns_ - 1 && RightLine(cell) &&
- LeftLine(cell_info[row][col+1].cellno)) // column_info[col+1].left_line)
+ if (col < columns_ - 1 && rightLine(cell) &&
+ leftLine(cell_info[row][col+1].cellno)) // column_info[col+1].left_line)
{
return WIDTH_OF_LINE;
} else {
// returns the maximum over all rows
-int LyXTabular::GetWidthOfColumn(int cell) const
+int LyXTabular::getWidthOfColumn(int cell) const
{
int const column1 = column_of_cell(cell);
int const column2 = right_column_of_cell(cell);
}
-int LyXTabular::GetWidthOfTabular() const
+int LyXTabular::getWidthOfTabular() const
{
return width_of_tabular;
}
-/* returns 1 if a complete update is necessary, otherwise 0 */
-bool LyXTabular::SetWidthOfMulticolCell(int cell, int new_width)
+// returns true if a complete update is necessary, otherwise false
+bool LyXTabular::setWidthOfMulticolCell(int cell, int new_width)
{
- if (!IsMultiColumn(cell))
+ if (!isMultiColumn(cell))
return false;
int const row = row_of_cell(cell);
(nmc == CELL_PART_OF_MULTICOLUMN)))
{
int const cellno = cell_info[row][column].cellno;
- SetWidthOfMulticolCell(cellno,
- GetWidthOfCell(cellno)-(2 * WIDTH_OF_LINE));
+ setWidthOfMulticolCell(cellno,
+ getWidthOfCell(cellno)-(2 * WIDTH_OF_LINE));
}
}
}
-/* returns 1 if a complete update is necessary, otherwise 0 */
-bool LyXTabular::SetWidthOfCell(int cell, int new_width)
+// returns 1 if a complete update is necessary, otherwise 0
+bool LyXTabular::setWidthOfCell(int cell, int new_width)
{
int const row = row_of_cell(cell);
int const column1 = column_of_cell(cell);
int add_width = 0;
#ifdef SPECIAL_COLUM_HANDLING
- if (RightLine(cell_info[row][column1].cellno, true) &&
+ if (rightLine(cell_info[row][column1].cellno, true) &&
(column1 < columns_-1) &&
- LeftLine(cell_info[row][column1+1].cellno, true))
+ leftLine(cell_info[row][column1+1].cellno, true))
#else
if (column_info[column1].right_line && (column1 < columns_-1) &&
column_info[column1+1].left_line) // additional width
// additional width
add_width = WIDTH_OF_LINE;
}
- if (GetWidthOfCell(cell) == (new_width+2*WIDTH_OF_LINE+add_width)) {
+ if (getWidthOfCell(cell) == (new_width+2*WIDTH_OF_LINE+add_width)) {
return false;
}
- if (IsMultiColumn(cell, true)) {
- tmp = SetWidthOfMulticolCell(cell, new_width);
+ if (isMultiColumn(cell, true)) {
+ tmp = setWidthOfMulticolCell(cell, new_width);
} else {
- width = (new_width + 2*WIDTH_OF_LINE + add_width);
+ width = new_width + 2 * WIDTH_OF_LINE + add_width;
cell_info[row][column1].width_of_cell = width;
tmp = calculate_width_of_column_NMC(column1);
if (tmp)
}
-bool LyXTabular::SetAlignment(int cell, LyXAlignment align, bool onlycolumn)
+bool LyXTabular::setAlignment(int cell, LyXAlignment align, bool onlycolumn)
{
- if (!IsMultiColumn(cell) || onlycolumn)
+ if (!isMultiColumn(cell) || onlycolumn)
column_info[column_of_cell(cell)].alignment = align;
if (!onlycolumn)
cellinfo_of_cell(cell)->alignment = align;
}
-bool LyXTabular::SetVAlignment(int cell, VAlignment align, bool onlycolumn)
+bool LyXTabular::setVAlignment(int cell, VAlignment align, bool onlycolumn)
{
- if (!IsMultiColumn(cell) || onlycolumn)
+ if (!isMultiColumn(cell) || onlycolumn)
column_info[column_of_cell(cell)].valignment = align;
if (!onlycolumn)
cellinfo_of_cell(cell)->valignment = align;
}
-bool LyXTabular::SetColumnPWidth(int cell, LyXLength const & width)
+bool LyXTabular::setColumnPWidth(int cell, LyXLength const & width)
{
bool flag = !width.zero();
int const j = column_of_cell(cell);
column_info[j].p_width = width;
// This should not ne necessary anymore
// if (flag) // do this only if there is a width
- // SetAlignment(cell, LYX_ALIGN_LEFT);
+ // setAlignment(cell, LYX_ALIGN_LEFT);
for (int i = 0; i < rows_; ++i) {
- int c = GetCellNumber(i, j);
- flag = !GetPWidth(c).zero(); // because of multicolumns!
- GetCellInset(c)->setAutoBreakRows(flag);
+ int c = getCellNumber(i, j);
+ flag = !getPWidth(c).zero(); // because of multicolumns!
+ getCellInset(c)->setAutoBreakRows(flag);
}
return true;
}
-bool LyXTabular::SetMColumnPWidth(int cell, LyXLength const & width)
+bool LyXTabular::setMColumnPWidth(int cell, LyXLength const & width)
{
bool const flag = !width.zero();
cellinfo_of_cell(cell)->p_width = width;
- if (IsMultiColumn(cell)) {
- GetCellInset(cell)->setAutoBreakRows(flag);
+ if (isMultiColumn(cell)) {
+ getCellInset(cell)->setAutoBreakRows(flag);
return true;
}
return false;
}
-bool LyXTabular::SetAlignSpecial(int cell, string const & special,
+bool LyXTabular::setAlignSpecial(int cell, string const & special,
LyXTabular::Feature what)
{
if (what == SET_SPECIAL_MULTI)
}
-bool LyXTabular::SetAllLines(int cell, bool line)
+bool LyXTabular::setAllLines(int cell, bool line)
{
- SetTopLine(cell, line);
- SetBottomLine(cell, line);
- SetRightLine(cell, line);
- SetLeftLine(cell, line);
+ setTopLine(cell, line);
+ setBottomLine(cell, line);
+ setRightLine(cell, line);
+ setLeftLine(cell, line);
return true;
}
-bool LyXTabular::SetTopLine(int cell, bool line, bool onlycolumn)
+bool LyXTabular::setTopLine(int cell, bool line, bool onlycolumn)
{
int const row = row_of_cell(cell);
- if (onlycolumn || !IsMultiColumn(cell))
+ if (onlycolumn || !isMultiColumn(cell))
row_info[row].top_line = line;
else
cellinfo_of_cell(cell)->top_line = line;
}
-bool LyXTabular::SetBottomLine(int cell, bool line, bool onlycolumn)
+bool LyXTabular::setBottomLine(int cell, bool line, bool onlycolumn)
{
- if (onlycolumn || !IsMultiColumn(cell))
+ if (onlycolumn || !isMultiColumn(cell))
row_info[row_of_cell(cell)].bottom_line = line;
else
cellinfo_of_cell(cell)->bottom_line = line;
}
-bool LyXTabular::SetLeftLine(int cell, bool line, bool onlycolumn)
+bool LyXTabular::setLeftLine(int cell, bool line, bool onlycolumn)
{
- if (onlycolumn || !IsMultiColumn(cell))
+ if (onlycolumn || !isMultiColumn(cell))
column_info[column_of_cell(cell)].left_line = line;
else
cellinfo_of_cell(cell)->left_line = line;
}
-bool LyXTabular::SetRightLine(int cell, bool line, bool onlycolumn)
+bool LyXTabular::setRightLine(int cell, bool line, bool onlycolumn)
{
- if (onlycolumn || !IsMultiColumn(cell))
+ if (onlycolumn || !isMultiColumn(cell))
column_info[right_column_of_cell(cell)].right_line = line;
else
cellinfo_of_cell(cell)->right_line = line;
}
-LyXAlignment LyXTabular::GetAlignment(int cell, bool onlycolumn) const
+LyXAlignment LyXTabular::getAlignment(int cell, bool onlycolumn) const
{
- if (!onlycolumn && IsMultiColumn(cell))
+ if (!onlycolumn && isMultiColumn(cell))
return cellinfo_of_cell(cell)->alignment;
else
return column_info[column_of_cell(cell)].alignment;
LyXTabular::VAlignment
-LyXTabular::GetVAlignment(int cell, bool onlycolumn) const
+LyXTabular::getVAlignment(int cell, bool onlycolumn) const
{
- if (!onlycolumn && IsMultiColumn(cell))
+ if (!onlycolumn && isMultiColumn(cell))
return cellinfo_of_cell(cell)->valignment;
else
return column_info[column_of_cell(cell)].valignment;
}
-LyXLength const LyXTabular::GetPWidth(int cell) const
+LyXLength const LyXTabular::getPWidth(int cell) const
{
- if (IsMultiColumn(cell))
+ if (isMultiColumn(cell))
return cellinfo_of_cell(cell)->p_width;
return column_info[column_of_cell(cell)].p_width;
}
-LyXLength const LyXTabular::GetColumnPWidth(int cell) const
+LyXLength const LyXTabular::getColumnPWidth(int cell) const
{
return column_info[column_of_cell(cell)].p_width;
}
-LyXLength const LyXTabular::GetMColumnPWidth(int cell) const
+LyXLength const LyXTabular::getMColumnPWidth(int cell) const
{
- if (IsMultiColumn(cell))
+ if (isMultiColumn(cell))
return cellinfo_of_cell(cell)->p_width;
return LyXLength();
}
-string const LyXTabular::GetAlignSpecial(int cell, int what) const
+string const LyXTabular::getAlignSpecial(int cell, int what) const
{
if (what == SET_SPECIAL_MULTI)
return cellinfo_of_cell(cell)->align_special;
}
-int LyXTabular::GetWidthOfCell(int cell) const
+int LyXTabular::getWidthOfCell(int cell) const
{
int const row = row_of_cell(cell);
int const column1 = column_of_cell(cell);
}
-int LyXTabular::GetBeginningOfTextInCell(int cell) const
+int LyXTabular::getBeginningOfTextInCell(int cell) const
{
int x = 0;
- switch (GetAlignment(cell)) {
+ switch (getAlignment(cell)) {
case LYX_ALIGN_CENTER:
- x += (GetWidthOfColumn(cell) - GetWidthOfCell(cell)) / 2;
+ x += (getWidthOfColumn(cell) - getWidthOfCell(cell)) / 2;
break;
case LYX_ALIGN_RIGHT:
- x += GetWidthOfColumn(cell) - GetWidthOfCell(cell);
- // + GetAdditionalWidth(cell);
+ x += getWidthOfColumn(cell) - getWidthOfCell(cell);
+ // + getAdditionalWidth(cell);
break;
- default: /* LYX_ALIGN_LEFT: nothing :-) */
+ default:
+ // LYX_ALIGN_LEFT: nothing :-)
break;
}
}
-bool LyXTabular::IsFirstCellInRow(int cell) const
+bool LyXTabular::isFirstCellInRow(int cell) const
{
return column_of_cell(cell) == 0;
}
-int LyXTabular::GetFirstCellInRow(int row) const
+int LyXTabular::getFirstCellInRow(int row) const
{
- if (row > (rows_-1))
+ if (row > rows_ - 1)
row = rows_ - 1;
return cell_info[row][0].cellno;
}
-bool LyXTabular::IsLastCellInRow(int cell) const
+bool LyXTabular::isLastCellInRow(int cell) const
{
return (right_column_of_cell(cell) == (columns_ - 1));
}
-int LyXTabular::GetLastCellInRow(int row) const
+int LyXTabular::getLastCellInRow(int row) const
{
- if (row > (rows_-1))
+ if (row > rows_ - 1)
row = rows_ - 1;
return cell_info[row][columns_-1].cellno;
}
int const old_column_width = column_info[column].width_of_column;
int max = 0;
for (int i = 0; i < rows_; ++i) {
- int cell = GetCellNumber(i, column);
- bool ismulti = IsMultiColumn(cell, true);
+ int cell = getCellNumber(i, column);
+ bool ismulti = isMultiColumn(cell, true);
if ((!ismulti || (column == right_column_of_cell(cell))) &&
(cell_info[i][column].width_of_cell > max))
{
}
-void LyXTabular::Write(Buffer const * buf, ostream & os) const
+void LyXTabular::write(Buffer const * buf, ostream & os) const
{
// header line
os << "<lyxtabular"
}
-void LyXTabular::Read(Buffer const * buf, LyXLex & lex)
+void LyXTabular::read(Buffer const * buf, LyXLex & lex)
{
string line;
istream & is = lex.getStream();
int columns_arg;
if (!getTokenValue(line, "columns", columns_arg))
return;
- Init(buf->params, rows_arg, columns_arg);
+ init(buf->params, rows_arg, columns_arg);
l_getline(is, line);
if (!prefixIs(line, "<features")) {
lyxerr << "Wrong tabular format (expected <features ...> got"
}
-bool LyXTabular::IsMultiColumn(int cell, bool real) const
+bool LyXTabular::isMultiColumn(int cell, bool real) const
{
- return ((!real || (column_of_cell(cell) != right_column_of_cell(cell))) &&
- (cellinfo_of_cell(cell)->multicolumn != LyXTabular::CELL_NORMAL));
+ return (!real || column_of_cell(cell) != right_column_of_cell(cell)) &&
+ (cellinfo_of_cell(cell)->multicolumn != LyXTabular::CELL_NORMAL);
}
{
int const row = row_of_cell(cell);
int const column = column_of_cell(cell);
- return &cell_info[row][column];
+ return &cell_info[row][column];
}
-void LyXTabular::SetMultiColumn(Buffer * buffer, int cell, int number)
+void LyXTabular::setMultiColumn(Buffer * buffer, int cell, int number)
{
cellinfo_of_cell(cell)->multicolumn = CELL_BEGIN_OF_MULTICOLUMN;
cellinfo_of_cell(cell)->alignment = column_info[column_of_cell(cell)].alignment;
}
-int LyXTabular::UnsetMultiColumn(int cell)
+int LyXTabular::unsetMultiColumn(int cell)
{
int const row = row_of_cell(cell);
int column = column_of_cell(cell);
}
-void LyXTabular::SetLongTabular(bool what)
+void LyXTabular::setLongTabular(bool what)
{
is_long_tabular = what;
}
-bool LyXTabular::IsLongTabular() const
+bool LyXTabular::isLongTabular() const
{
return is_long_tabular;
}
-void LyXTabular::SetRotateTabular(bool flag)
+void LyXTabular::setRotateTabular(bool flag)
{
rotate = flag;
}
-bool LyXTabular::GetRotateTabular() const
+bool LyXTabular::getRotateTabular() const
{
return rotate;
}
-void LyXTabular::SetRotateCell(int cell, bool flag)
+void LyXTabular::setRotateCell(int cell, bool flag)
{
cellinfo_of_cell(cell)->rotate = flag;
}
-bool LyXTabular::GetRotateCell(int cell) const
+bool LyXTabular::getRotateCell(int cell) const
{
return cellinfo_of_cell(cell)->rotate;
}
-bool LyXTabular::NeedRotating() const
+bool LyXTabular::needRotating() const
{
if (rotate)
return true;
}
-bool LyXTabular::IsLastCell(int cell) const
+bool LyXTabular::isLastCell(int cell) const
{
- if ((cell + 1) < numberofcells)
+ if (cell + 1 < numberofcells)
return false;
return true;
}
-int LyXTabular::GetCellAbove(int cell) const
+int LyXTabular::getCellAbove(int cell) const
{
if (row_of_cell(cell) > 0)
return cell_info[row_of_cell(cell)-1][column_of_cell(cell)].cellno;
}
-int LyXTabular::GetCellBelow(int cell) const
+int LyXTabular::getCellBelow(int cell) const
{
if (row_of_cell(cell) + 1 < rows_)
return cell_info[row_of_cell(cell)+1][column_of_cell(cell)].cellno;
}
-int LyXTabular::GetLastCellAbove(int cell) const
+int LyXTabular::getLastCellAbove(int cell) const
{
if (row_of_cell(cell) <= 0)
return cell;
- if (!IsMultiColumn(cell))
- return GetCellAbove(cell);
+ if (!isMultiColumn(cell))
+ return getCellAbove(cell);
return cell_info[row_of_cell(cell) - 1][right_column_of_cell(cell)].cellno;
}
-int LyXTabular::GetLastCellBelow(int cell) const
+int LyXTabular::getLastCellBelow(int cell) const
{
if (row_of_cell(cell) + 1 >= rows_)
return cell;
- if (!IsMultiColumn(cell))
- return GetCellBelow(cell);
+ if (!isMultiColumn(cell))
+ return getCellBelow(cell);
return cell_info[row_of_cell(cell) + 1][right_column_of_cell(cell)].cellno;
}
-int LyXTabular::GetCellNumber(int row, int column) const
+int LyXTabular::getCellNumber(int row, int column) const
{
#if 0
if (column >= columns_)
}
-void LyXTabular::SetUsebox(int cell, BoxType type)
+void LyXTabular::setUsebox(int cell, BoxType type)
{
cellinfo_of_cell(cell)->usebox = type;
}
-LyXTabular::BoxType LyXTabular::GetUsebox(int cell) const
+LyXTabular::BoxType LyXTabular::getUsebox(int cell) const
{
if (column_info[column_of_cell(cell)].p_width.zero() &&
- !(IsMultiColumn(cell) && !cellinfo_of_cell(cell)->p_width.zero()))
+ !(isMultiColumn(cell) && !cellinfo_of_cell(cell)->p_width.zero()))
return BOX_NONE;
if (cellinfo_of_cell(cell)->usebox > 1)
return cellinfo_of_cell(cell)->usebox;
- return UseParbox(cell);
+ return useParbox(cell);
}
///
// This are functions used for the longtable support
///
-void LyXTabular::SetLTHead(int row, bool flag, ltType const & hd, bool first)
+void LyXTabular::setLTHead(int row, bool flag, ltType const & hd, bool first)
{
if (first) {
endfirsthead = hd;
}
-bool LyXTabular::GetRowOfLTHead(int row, ltType & hd) const
+bool LyXTabular::getRowOfLTHead(int row, ltType & hd) const
{
hd = endhead;
hd.set = haveLTHead();
}
-bool LyXTabular::GetRowOfLTFirstHead(int row, ltType & hd) const
+bool LyXTabular::getRowOfLTFirstHead(int row, ltType & hd) const
{
hd = endfirsthead;
hd.set = haveLTFirstHead();
}
-void LyXTabular::SetLTFoot(int row, bool flag, ltType const & fd, bool last)
+void LyXTabular::setLTFoot(int row, bool flag, ltType const & fd, bool last)
{
if (last) {
endlastfoot = fd;
}
-bool LyXTabular::GetRowOfLTFoot(int row, ltType & fd) const
+bool LyXTabular::getRowOfLTFoot(int row, ltType & fd) const
{
fd = endfoot;
fd.set = haveLTFoot();
}
-bool LyXTabular::GetRowOfLTLastFoot(int row, ltType & fd) const
+bool LyXTabular::getRowOfLTLastFoot(int row, ltType & fd) const
{
fd = endlastfoot;
fd.set = haveLTLastFoot();
}
-void LyXTabular::SetLTNewPage(int row, bool what)
+void LyXTabular::setLTNewPage(int row, bool what)
{
row_info[row].newpage = what;
}
-bool LyXTabular::GetLTNewPage(int row) const
+bool LyXTabular::getLTNewPage(int row) const
{
return row_info[row].newpage;
}
bool LyXTabular::haveLTHead() const
{
- for(int i=0; i < rows_; ++i) {
+ for (int i = 0; i < rows_; ++i) {
if (row_info[i].endhead)
return true;
}
{
if (endfirsthead.empty)
return false;
- for(int i=0; i < rows_; ++i) {
+ for (int i = 0; i < rows_; ++i) {
if (row_info[i].endfirsthead)
return true;
}
bool LyXTabular::haveLTFoot() const
{
- for(int i=0; i < rows_; ++i) {
+ for (int i = 0; i < rows_; ++i) {
if (row_info[i].endfoot)
return true;
}
{
if (endlastfoot.empty)
return false;
- for(int i=0; i < rows_; ++i) {
+ for (int i = 0; i < rows_; ++i) {
if (row_info[i].endlastfoot)
return true;
}
// end longtable support functions
-bool LyXTabular::SetAscentOfRow(int row, int height)
+bool LyXTabular::setAscentOfRow(int row, int height)
{
- if ((row >= rows_) || (row_info[row].ascent_of_row == height))
+ if (row >= rows_ || row_info[row].ascent_of_row == height)
return false;
row_info[row].ascent_of_row = height;
return true;
}
-bool LyXTabular::SetDescentOfRow(int row, int height)
+bool LyXTabular::setDescentOfRow(int row, int height)
{
- if ((row >= rows_) || (row_info[row].descent_of_row == height))
+ if (row >= rows_ || row_info[row].descent_of_row == height)
return false;
row_info[row].descent_of_row = height;
return true;
}
-int LyXTabular::GetAscentOfRow(int row) const
+int LyXTabular::getAscentOfRow(int row) const
{
if (row >= rows_)
return 0;
}
-int LyXTabular::GetDescentOfRow(int row) const
+int LyXTabular::getDescentOfRow(int row) const
{
if (row >= rows_)
return 0;
}
-int LyXTabular::GetHeightOfTabular() const
+int LyXTabular::getHeightOfTabular() const
{
int height = 0;
for (int row = 0; row < rows_; ++row)
- height += GetAscentOfRow(row) + GetDescentOfRow(row) +
- GetAdditionalHeight(row);
+ height += getAscentOfRow(row) + getDescentOfRow(row) +
+ getAdditionalHeight(row);
return height;
}
-bool LyXTabular::IsPartOfMultiColumn(int row, int column) const
+bool LyXTabular::isPartOfMultiColumn(int row, int column) const
{
if ((row >= rows_) || (column >= columns_))
return false;
if ((row < 0) || (row >= rows_))
return 0;
- int const fcell = GetFirstCellInRow(row);
- int const n = NumberOfCellsInRow(fcell) + fcell;
+ int const fcell = getFirstCellInRow(row);
+ int const n = numberOfCellsInRow(fcell) + fcell;
int tmp = 0;
for (int i = fcell; i < n; ++i) {
- if (TopLine(i))
+ if (topLine(i))
++tmp;
}
if (tmp == (n - fcell)) {
os << "\\hline ";
} else if (tmp) {
for (int i = fcell; i < n; ++i) {
- if (TopLine(i)) {
+ if (topLine(i)) {
os << "\\cline{"
<< column_of_cell(i) + 1
<< '-'
if ((row < 0) || (row >= rows_))
return 0;
- int const fcell = GetFirstCellInRow(row);
- int const n = NumberOfCellsInRow(fcell) + fcell;
+ int const fcell = getFirstCellInRow(row);
+ int const n = numberOfCellsInRow(fcell) + fcell;
int tmp = 0;
for (int i = fcell; i < n; ++i) {
- if (BottomLine(i))
+ if (bottomLine(i))
++tmp;
}
if (tmp == (n - fcell)) {
os << "\\hline";
} else if (tmp) {
for (int i = fcell; i < n; ++i) {
- if (BottomLine(i)) {
+ if (bottomLine(i)) {
os << "\\cline{"
<< column_of_cell(i) + 1
<< '-'
{
int ret = 0;
- if (GetRotateCell(cell)) {
+ if (getRotateCell(cell)) {
os << "\\begin{sideways}\n";
++ret;
}
- if (IsMultiColumn(cell)) {
+ if (isMultiColumn(cell)) {
os << "\\multicolumn{" << cells_in_multicolumn(cell) << "}{";
if (!cellinfo_of_cell(cell)->align_special.empty()) {
os << cellinfo_of_cell(cell)->align_special << "}{";
} else {
- if (LeftLine(cell) &&
- (IsFirstCellInRow(cell) ||
- (!IsMultiColumn(cell-1) && !LeftLine(cell, true) &&
- !RightLine(cell-1, true))))
+ if (leftLine(cell) &&
+ (isFirstCellInRow(cell) ||
+ (!isMultiColumn(cell-1) && !leftLine(cell, true) &&
+ !rightLine(cell-1, true))))
{
os << '|';
}
- if (!GetPWidth(cell).zero()) {
- switch (GetVAlignment(cell)) {
+ if (!getPWidth(cell).zero()) {
+ switch (getVAlignment(cell)) {
case LYX_VALIGN_TOP:
os << 'p';
break;
break;
}
os << '{'
- << GetPWidth(cell).asLatexString()
+ << getPWidth(cell).asLatexString()
<< '}';
} else {
- switch (GetAlignment(cell)) {
+ switch (getAlignment(cell)) {
case LYX_ALIGN_LEFT:
os << 'l';
break;
break;
}
}
- if (RightLine(cell))
+ if (rightLine(cell))
os << '|';
- if (((cell + 1) < numberofcells) && !IsFirstCellInRow(cell+1) &&
- LeftLine(cell+1))
+ if (((cell + 1) < numberofcells) && !isFirstCellInRow(cell+1) &&
+ leftLine(cell+1))
os << '|';
os << "}{";
}
}
- if (GetUsebox(cell) == BOX_PARBOX) {
+ if (getUsebox(cell) == BOX_PARBOX) {
os << "\\parbox[";
- switch (GetVAlignment(cell)) {
+ switch (getVAlignment(cell)) {
case LYX_VALIGN_TOP:
os << 't';
break;
os << 'b';
break;
}
- os << "]{" << GetPWidth(cell).asLatexString() << "}{";
- } else if (GetUsebox(cell) == BOX_MINIPAGE) {
+ os << "]{" << getPWidth(cell).asLatexString() << "}{";
+ } else if (getUsebox(cell) == BOX_MINIPAGE) {
os << "\\begin{minipage}[";
- switch (GetVAlignment(cell)) {
+ switch (getVAlignment(cell)) {
case LYX_VALIGN_TOP:
os << 't';
break;
os << 'b';
break;
}
- os << "]{" << GetPWidth(cell).asLatexString() << "}\n";
+ os << "]{" << getPWidth(cell).asLatexString() << "}\n";
++ret;
}
return ret;
int ret = 0;
// usual cells
- if (GetUsebox(cell) == BOX_PARBOX)
+ if (getUsebox(cell) == BOX_PARBOX)
os << '}';
- else if (GetUsebox(cell) == BOX_MINIPAGE) {
+ else if (getUsebox(cell) == BOX_MINIPAGE) {
os << "%\n\\end{minipage}";
ret += 2;
}
- if (IsMultiColumn(cell)) {
+ if (isMultiColumn(cell)) {
os << '}';
}
- if (GetRotateCell(cell)) {
+ if (getRotateCell(cell)) {
os << "%\n\\end{sideways}";
++ret;
}
LatexRunParams const & runparams) const
{
int ret = 0;
- int cell = GetCellNumber(i, 0);
+ int cell = getCellNumber(i, 0);
ret += TeXTopHLine(os, i);
for (int j = 0; j < columns_; ++j) {
- if (IsPartOfMultiColumn(i,j))
+ if (isPartOfMultiColumn(i,j))
continue;
ret += TeXCellPreamble(os, cell);
- InsetText * inset = GetCellInset(cell);
+ InsetText * inset = getCellInset(cell);
bool rtl = inset->paragraphs.begin()->isRightToLeftPar(buf->params) &&
- !inset->paragraphs.begin()->empty() && GetPWidth(cell).zero();
+ !inset->paragraphs.begin()->empty() && getPWidth(cell).zero();
if (rtl)
os << "\\R{";
os << '}';
ret += TeXCellPostamble(os, cell);
- if (!IsLastCellInRow(cell)) { // not last cell in row
+ if (!isLastCellInRow(cell)) { // not last cell in row
os << "&\n";
++ret;
}
int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const
{
int ret = 0;
- int cell = GetFirstCellInRow(row);
+ int cell = getFirstCellInRow(row);
os << "<row>\n";
for (int j = 0; j < columns_; ++j) {
- if (IsPartOfMultiColumn(row, j))
+ if (isPartOfMultiColumn(row, j))
continue;
os << "<entry align=\"";
- switch (GetAlignment(cell)) {
+ switch (getAlignment(cell)) {
case LYX_ALIGN_LEFT:
os << "left";
break;
}
os << "\" valign=\"";
- switch (GetVAlignment(cell)) {
+ switch (getVAlignment(cell)) {
case LYX_VALIGN_TOP:
os << "top";
break;
}
os << '"';
- if (IsMultiColumn(cell)) {
+ if (isMultiColumn(cell)) {
os << " namest=\"col" << j << "\" ";
os << "nameend=\"col" << j + cells_in_multicolumn(cell) - 1<< '"';
}
os << '>';
- ret += GetCellInset(cell)->docbook(buf, os, true);
+ ret += getCellInset(cell)->docbook(buf, os, true);
os << "</entry>\n";
++cell;
}
return ret;
}
-//--
-// ASCII export function and helpers
-//--
+
int LyXTabular::asciiTopHLine(ostream & os, int row,
vector<unsigned int> const & clen) const
{
- int const fcell = GetFirstCellInRow(row);
- int const n = NumberOfCellsInRow(fcell) + fcell;
+ int const fcell = getFirstCellInRow(row);
+ int const n = numberOfCellsInRow(fcell) + fcell;
int tmp = 0;
for (int i = fcell; i < n; ++i) {
- if (TopLine(i)) {
+ if (topLine(i)) {
++tmp;
break;
}
unsigned char ch;
for (int i = fcell; i < n; ++i) {
- if (TopLine(i)) {
- if (LeftLine(i))
+ if (topLine(i)) {
+ if (leftLine(i))
os << "+-";
else
os << "--";
}
int column = column_of_cell(i);
int len = clen[column];
- while (IsPartOfMultiColumn(row, ++column))
+ while (isPartOfMultiColumn(row, ++column))
len += clen[column] + 4;
os << string(len, ch);
- if (TopLine(i)) {
- if (RightLine(i))
+ if (topLine(i)) {
+ if (rightLine(i))
os << "-+";
else
os << "--";
int LyXTabular::asciiBottomHLine(ostream & os, int row,
vector<unsigned int> const & clen) const
{
- int const fcell = GetFirstCellInRow(row);
- int const n = NumberOfCellsInRow(fcell) + fcell;
+ int const fcell = getFirstCellInRow(row);
+ int const n = numberOfCellsInRow(fcell) + fcell;
int tmp = 0;
for (int i = fcell; i < n; ++i) {
- if (BottomLine(i)) {
+ if (bottomLine(i)) {
++tmp;
break;
}
unsigned char ch;
for (int i = fcell; i < n; ++i) {
- if (BottomLine(i)) {
- if (LeftLine(i))
+ if (bottomLine(i)) {
+ if (leftLine(i))
os << "+-";
else
os << "--";
}
int column = column_of_cell(i);
int len = clen[column];
- while (IsPartOfMultiColumn(row, ++column))
+ while (isPartOfMultiColumn(row, ++column))
len += clen[column] + 4;
os << string(len, ch);
- if (BottomLine(i)) {
- if (RightLine(i))
+ if (bottomLine(i)) {
+ if (rightLine(i))
os << "-+";
else
os << "--";
bool onlydata) const
{
ostringstream sstr;
- int ret = GetCellInset(cell)->ascii(buf, sstr, 0);
+ int ret = getCellInset(cell)->ascii(buf, sstr, 0);
if (onlydata) {
os << sstr.str();
return ret;
}
- if (LeftLine(cell))
+ if (leftLine(cell))
os << "| ";
else
os << " ";
unsigned int len1 = sstr.str().length();
unsigned int len2 = clen[column];
- while (IsPartOfMultiColumn(row, ++column))
+ while (isPartOfMultiColumn(row, ++column))
len2 += clen[column] + 4;
len2 -= len1;
- switch (GetAlignment(cell)) {
+ switch (getAlignment(cell)) {
default:
case LYX_ALIGN_LEFT:
len1 = 0;
os << string(len1, ' ') << sstr.str() << string(len2, ' ');
- if (RightLine(cell))
+ if (rightLine(cell))
os << " |";
else
os << " ";
for (int j = 0; j < columns_; ++j) {
clen[j] = 0;
for (int i = 0; i < rows_; ++i) {
- int cell = GetCellNumber(i, j);
- if (IsMultiColumn(cell, true))
+ int cell = getCellNumber(i, j);
+ 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();
}
// then all (real) multicolumn cells!
for (int j = 0; j < columns_; ++j) {
for (int i = 0; i < rows_; ++i) {
- int cell = GetCellNumber(i, j);
- if (!IsMultiColumn(cell, true) || IsPartOfMultiColumn(i, j))
+ int cell = getCellNumber(i, j);
+ 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)
}
}
for (int j = 0; j < columns_; ++j) {
- if (IsPartOfMultiColumn(i,j))
+ if (isPartOfMultiColumn(i,j))
continue;
if (onlydata && j > 0)
os << delim;
}
return ret;
}
-//--
-// end ascii export
-//--
-InsetText * LyXTabular::GetCellInset(int cell) const
+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
+InsetText * LyXTabular::getCellInset(int row, int column) const
{
- cur_cell = GetCellNumber(row, column);
+ cur_cell = getCellNumber(row, column);
return & cell_info[row][column].inset;
}
-int LyXTabular::GetCellFromInset(Inset const * inset, int maybe_cell) const
+int LyXTabular::getCellFromInset(Inset const * inset, int maybe_cell) const
{
// is this inset part of the tabular?
if (!inset || inset->owner() != owner_) {
const int save_cur_cell = cur_cell;
int cell = cur_cell;
- if (GetCellInset(cell) != inset) {
+ if (getCellInset(cell) != inset) {
cell = maybe_cell;
- if (cell == -1 || GetCellInset(cell) != inset) {
+ if (cell == -1 || getCellInset(cell) != inset) {
cell = -1;
}
}
if (cell == -1) {
- for (cell = GetNumberOfCells(); cell >= 0; --cell) {
- if (GetCellInset(cell) == inset)
+ for (cell = getNumberOfCells(); cell >= 0; --cell) {
+ if (getCellInset(cell) == inset)
break;
}
lyxerr[Debug::INSETTEXT]
- << "LyXTabular::GetCellFromInset: "
+ << "LyXTabular::getCellFromInset: "
<< "cell=" << cell
<< ", cur_cell=" << save_cur_cell
<< ", maybe_cell=" << maybe_cell
<< endl;
// We should have found a cell at this point
if (cell == -1) {
- lyxerr << "LyXTabular::GetCellFromInset: "
+ lyxerr << "LyXTabular::getCellFromInset: "
<< "Cell not found!" << endl;
}
}
}
-void LyXTabular::Validate(LaTeXFeatures & features) const
+void LyXTabular::validate(LaTeXFeatures & features) const
{
features.require("NeedTabularnewline");
- if (IsLongTabular())
+ if (isLongTabular())
features.require("longtable");
- if (NeedRotating())
+ if (needRotating())
features.require("rotating");
for (int cell = 0; cell < numberofcells; ++cell) {
- if ((GetVAlignment(cell) != LYX_VALIGN_TOP) ||
- (!(GetPWidth(cell).zero())&&!(IsMultiColumn(cell))))
+ if (getVAlignment(cell) != LYX_VALIGN_TOP ||
+ (!getPWidth(cell).zero() && !isMultiColumn(cell)))
features.require("array");
- GetCellInset(cell)->validate(features);
+ getCellInset(cell)->validate(features);
}
}
for (int i = 0; i < rows_; ++i)
for (int j = 0; j < columns_; ++j) {
vector<string> const l =
- GetCellInset(i, j)->getLabelList();
+ getCellInset(i, j)->getLabelList();
label_list.insert(label_list.end(),
l.begin(), l.end());
}
}
-LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
+LyXTabular::BoxType LyXTabular::useParbox(int cell) const
{
- ParagraphList const & parlist = GetCellInset(cell)->paragraphs;
+ ParagraphList const & parlist = getCellInset(cell)->paragraphs;
ParagraphList::const_iterator cit = parlist.begin();
ParagraphList::const_iterator end = parlist.end();
struct ltType {
// constructor
ltType();
- // we have this header type (is set in the GetLT... functions)
+ // we have this header type (is set in the getLT... functions)
bool set;
// double borders on top
bool topDL;
bool empty;
};
- /* konstruktor */
- ///
+ /// constructor
LyXTabular(BufferParams const &,
InsetTabular *, int columns_arg, int rows_arg);
- ///
+ /// sort of copy constructir
LyXTabular(BufferParams const &,
InsetTabular *, LyXTabular const &);
///
LyXTabular * clone(BufferParams const &, InsetTabular *);
/// Returns true if there is a topline, returns false if not
- bool TopLine(int cell, bool onlycolumn = false) const;
+ bool topLine(int cell, bool onlycolumn = false) const;
/// Returns true if there is a topline, returns false if not
- bool BottomLine(int cell, bool onlycolumn = false) const;
+ bool bottomLine(int cell, bool onlycolumn = false) const;
/// Returns true if there is a topline, returns false if not
- bool LeftLine(int cell, bool onlycolumn = false) const;
+ bool leftLine(int cell, bool onlycolumn = false) const;
/// Returns true if there is a topline, returns false if not
- bool RightLine(int cell, bool onlycolumn = false) const;
+ bool rightLine(int cell, bool onlycolumn = false) const;
///
bool topAlreadyDrawn(int cell) const;
///
bool leftAlreadyDrawn(int cell) const;
///
- bool IsLastRow(int cell) const;
+ bool isLastRow(int cell) const;
///
- int GetAdditionalHeight(int row) const;
+ int getAdditionalHeight(int row) const;
///
- int GetAdditionalWidth(int cell) const;
+ int getAdditionalWidth(int cell) const;
/* returns the maximum over all rows */
///
- int GetWidthOfColumn(int cell) const;
+ int getWidthOfColumn(int cell) const;
///
- int GetWidthOfTabular() const;
+ int getWidthOfTabular() const;
///
- int GetAscentOfRow(int row) const;
+ int getAscentOfRow(int row) const;
///
- int GetDescentOfRow(int row) const;
+ int getDescentOfRow(int row) const;
///
- int GetHeightOfTabular() const;
+ int getHeightOfTabular() const;
/// Returns true if a complete update is necessary, otherwise false
- bool SetAscentOfRow(int row, int height);
+ bool setAscentOfRow(int row, int height);
/// Returns true if a complete update is necessary, otherwise false
- bool SetDescentOfRow(int row, int height);
+ bool setDescentOfRow(int row, int height);
/// Returns true if a complete update is necessary, otherwise false
- bool SetWidthOfCell(int cell, int new_width);
+ bool setWidthOfCell(int cell, int new_width);
/// Returns true if a complete update is necessary, otherwise false
- bool SetAllLines(int cell, bool line);
+ bool setAllLines(int cell, bool line);
/// Returns true if a complete update is necessary, otherwise false
- bool SetTopLine(int cell, bool line, bool onlycolumn = false);
+ bool setTopLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetBottomLine(int cell, bool line, bool onlycolumn = false);
+ bool setBottomLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetLeftLine(int cell, bool line, bool onlycolumn = false);
+ bool setLeftLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetRightLine(int cell, bool line, bool onlycolumn = false);
+ bool setRightLine(int cell, bool line, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetAlignment(int cell, LyXAlignment align,
+ bool setAlignment(int cell, LyXAlignment align,
bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetVAlignment(int cell, VAlignment align,
+ bool setVAlignment(int cell, VAlignment align,
bool onlycolumn = false);
///
- bool SetColumnPWidth(int cell, LyXLength const & width);
+ bool setColumnPWidth(int cell, LyXLength const & width);
///
- bool SetMColumnPWidth(int cell, LyXLength const & width);
+ bool setMColumnPWidth(int cell, LyXLength const & width);
///
- bool SetAlignSpecial(int cell, string const & special, Feature what);
+ bool setAlignSpecial(int cell, string const & special, Feature what);
///
- LyXAlignment GetAlignment(int cell, bool onlycolumn = false) const;
+ LyXAlignment getAlignment(int cell, bool onlycolumn = false) const;
///
- VAlignment GetVAlignment(int cell, bool onlycolumn = false) const;
+ VAlignment getVAlignment(int cell, bool onlycolumn = false) const;
///
- LyXLength const GetPWidth(int cell) const;
+ LyXLength const getPWidth(int cell) const;
///
- LyXLength const GetColumnPWidth(int cell) const;
+ LyXLength const getColumnPWidth(int cell) const;
///
- LyXLength const GetMColumnPWidth(int cell) const;
+ LyXLength const getMColumnPWidth(int cell) const;
///
- string const GetAlignSpecial(int cell, int what) const;
+ string const getAlignSpecial(int cell, int what) const;
///
- int GetWidthOfCell(int cell) const;
+ int getWidthOfCell(int cell) const;
///
- int GetBeginningOfTextInCell(int cell) const;
+ int getBeginningOfTextInCell(int cell) const;
///
- void AppendRow(BufferParams const &, int cell);
+ void appendRow(BufferParams const &, int cell);
///
- void DeleteRow(int row);
+ void deleteRow(int row);
///
- void AppendColumn(BufferParams const &, int cell);
+ void appendColumn(BufferParams const &, int cell);
///
- void DeleteColumn(int column);
+ void deleteColumn(int column);
///
- bool IsFirstCellInRow(int cell) const;
+ bool isFirstCellInRow(int cell) const;
///
- int GetFirstCellInRow(int row) const;
+ int getFirstCellInRow(int row) const;
///
- bool IsLastCellInRow(int cell) const;
+ bool isLastCellInRow(int cell) const;
///
- int GetLastCellInRow(int row) const;
+ int getLastCellInRow(int row) const;
///
- int GetNumberOfCells() const;
+ int getNumberOfCells() const;
///
- int NumberOfCellsInRow(int cell) const;
+ int numberOfCellsInRow(int cell) const;
///
- void Write(Buffer const *, std::ostream &) const;
+ void write(Buffer const *, std::ostream &) const;
///
- void Read(Buffer const *, LyXLex &);
+ void read(Buffer const *, LyXLex &);
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
int ascii(Buffer const *, std::ostream &, int const depth,
bool onlydata, unsigned char delim) const;
///
- bool IsMultiColumn(int cell, bool real = false) const;
+ bool isMultiColumn(int cell, bool real = false) const;
///
- void SetMultiColumn(Buffer *, int cell, int number);
+ void setMultiColumn(Buffer *, int cell, int number);
///
- int UnsetMultiColumn(int cell); // returns number of new cells
+ int unsetMultiColumn(int cell); // returns number of new cells
///
- bool IsPartOfMultiColumn(int row, int column) const;
+ bool isPartOfMultiColumn(int row, int column) const;
///
int row_of_cell(int cell) const;
///
///
int right_column_of_cell(int cell) const;
///
- void SetLongTabular(bool);
+ void setLongTabular(bool);
///
- bool IsLongTabular() const;
+ bool isLongTabular() const;
///
- void SetRotateTabular(bool);
+ void setRotateTabular(bool);
///
- bool GetRotateTabular() const;
+ bool getRotateTabular() const;
///
- void SetRotateCell(int cell, bool);
+ void setRotateCell(int cell, bool);
///
- bool GetRotateCell(int cell) const;
+ bool getRotateCell(int cell) const;
///
- bool NeedRotating() const;
+ bool needRotating() const;
///
- bool IsLastCell(int cell) const;
+ bool isLastCell(int cell) const;
///
- int GetCellAbove(int cell) const;
+ int getCellAbove(int cell) const;
///
- int GetCellBelow(int cell) const;
+ int getCellBelow(int cell) const;
///
- int GetLastCellAbove(int cell) const;
+ int getLastCellAbove(int cell) const;
///
- int GetLastCellBelow(int cell) const;
+ int getLastCellBelow(int cell) const;
///
- int GetCellNumber(int row, int column) const;
+ int getCellNumber(int row, int column) const;
///
- void SetUsebox(int cell, BoxType);
+ void setUsebox(int cell, BoxType);
///
- BoxType GetUsebox(int cell) const;
+ BoxType getUsebox(int cell) const;
//
// Long Tabular Options support functions
///
bool checkLTType(int row, ltType const &) const;
///
- void SetLTHead(int row, bool flag, ltType const &, bool first);
+ void setLTHead(int row, bool flag, ltType const &, bool first);
///
- bool GetRowOfLTHead(int row, ltType &) const;
+ bool getRowOfLTHead(int row, ltType &) const;
///
- bool GetRowOfLTFirstHead(int row, ltType &) const;
+ bool getRowOfLTFirstHead(int row, ltType &) const;
///
- void SetLTFoot(int row, bool flag, ltType const &, bool last);
+ void setLTFoot(int row, bool flag, ltType const &, bool last);
///
- bool GetRowOfLTFoot(int row, ltType &) const;
+ bool getRowOfLTFoot(int row, ltType &) const;
///
- bool GetRowOfLTLastFoot(int row, ltType &) const;
+ bool getRowOfLTLastFoot(int row, ltType &) const;
///
- void SetLTNewPage(int row, bool what);
+ void setLTNewPage(int row, bool what);
///
- bool GetLTNewPage(int row) const;
+ bool getLTNewPage(int row) const;
///
bool haveLTHead() const;
///
///
// end longtable support
///
- InsetText * GetCellInset(int cell) const;
+ InsetText * getCellInset(int cell) const;
///
- InsetText * GetCellInset(int row, int column) const;
+ InsetText * getCellInset(int row, int column) const;
/// Search for \param inset in the tabular, with the
/// additional hint that it could be at \param maybe_cell
- int GetCellFromInset(Inset const * inset, int maybe_cell = -1) const;
+ int getCellFromInset(Inset const * inset, int maybe_cell = -1) const;
///
int rows() const { return rows_; }
///
int columns() const { return columns_;}
///
- InsetTabular * owner() const { return owner_; }
- ///
- void Validate(LaTeXFeatures &) const;
+ void validate(LaTeXFeatures &) const;
///
std::vector<string> const getLabelList() const;
///
/// recalculate the widths/heights only!
void reinit();
+private:
///
mutable int cur_cell;
-private:
///
struct cellstruct {
///
InsetTabular * owner_;
///
- void Init(BufferParams const &,
+ void init(BufferParams const &,
int columns_arg, int rows_arg, LyXTabular const * lt = 0);
///
void Reinit(bool reset_widths = true);
///
void set_row_column_number_info(bool oldformat = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetWidthOfMulticolCell(int cell, int new_width);
+ bool setWidthOfMulticolCell(int cell, int new_width);
///
void recalculateMulticolumnsOfColumn(int column);
/// Returns true if change
///
int cells_in_multicolumn(int cell) const;
///
- BoxType UseParbox(int cell) const;
+ BoxType useParbox(int cell) const;
///
void setHeaderFooterRows(int header, int fheader, int footer, int lfooter);
///
string const tostr(LyXTabular::BoxType const & num);
// I would have liked a fromstr template a lot better. (Lgb)
-extern bool string2type(string const str, LyXAlignment & num);
-extern bool string2type(string const str, LyXTabular::VAlignment & num);
-extern bool string2type(string const str, LyXTabular::BoxType & num);
-extern bool string2type(string const str, bool & num);
-extern bool getTokenValue(string const & str, char const * token, string &ret);
-extern bool getTokenValue(string const & str, char const * token, int & num);
-extern bool getTokenValue(string const & str, char const * token,
+bool string2type(string const str, LyXAlignment & num);
+bool string2type(string const str, LyXTabular::VAlignment & num);
+bool string2type(string const str, LyXTabular::BoxType & num);
+bool string2type(string const str, bool & num);
+bool getTokenValue(string const & str, char const * token, string &ret);
+bool getTokenValue(string const & str, char const * token, int & num);
+bool getTokenValue(string const & str, char const * token,
LyXAlignment & num);
-extern bool getTokenValue(string const & str, char const * token,
+bool getTokenValue(string const & str, char const * token,
LyXTabular::VAlignment & num);
-extern bool getTokenValue(string const & str, char const * token,
+bool getTokenValue(string const & str, char const * token,
LyXTabular::BoxType & num);
-extern bool getTokenValue(string const & str, char const * token, bool & flag);
-extern bool getTokenValue(string const & str, char const * token,
+bool getTokenValue(string const & str, char const * token, bool & flag);
+bool getTokenValue(string const & str, char const * token,
LyXLength & len);
-extern void l_getline(std::istream & is, string & str);
+void l_getline(std::istream & is, string & str);
#endif