rotate(cs.rotate),
align_special(cs.align_special),
p_width(cs.p_width),
- inset(dynamic_cast<InsetTableCell *>(cs.inset->clone()))
+ inset(static_cast<InsetTableCell *>(cs.inset->clone()))
{
}
}
} else if (row == 0) {
for (col_type c = 0; c < ncols(); ++c) {
- for ( ; c < ncols() && !topline[c]; ++c) {}
-
- col_type offset = 0;
- for (col_type j = 0 ; j < c; ++j)
- if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
- ++offset;
-
- //babel makes the "-" character an active one, so we have to suppress this here
- //see http://groups.google.com/group/comp.text.tex/browse_thread/thread/af769424a4a0f289#
- if (lang == "slovak" || lang == "czech")
- os << "\\expandafter" << (use_booktabs ? "\\cmidrule" : "\\cline")
- << "\\expandafter{\\expandafter" << c + 1 + offset << "\\string-";
- else
- os << (use_booktabs ? "\\cmidrule{" : "\\cline{") << c + 1 + offset << '-';
-
- col_type cstart = c;
- for ( ; c < ncols() && topline[c]; ++c) {}
-
- for (col_type j = cstart ; j < c ; ++j)
- if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
- ++offset;
-
- os << c + offset << "} ";
+ if (topline[c]) {
+ col_type offset = 0;
+ for (col_type j = 0 ; j < c; ++j)
+ if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
+ ++offset;
+
+ //babel makes the "-" character an active one, so we have to suppress this here
+ //see http://groups.google.com/group/comp.text.tex/browse_thread/thread/af769424a4a0f289#
+ if (lang == "slovak" || lang == "czech")
+ os << "\\expandafter" << (use_booktabs ? "\\cmidrule" : "\\cline")
+ << "\\expandafter{\\expandafter" << c + 1 + offset << "\\string-";
+ else
+ os << (use_booktabs ? "\\cmidrule{" : "\\cline{") << c + 1 + offset << '-';
+
+ col_type cstart = c;
+ for ( ; c < ncols() && topline[c]; ++c) {}
+
+ for (col_type j = cstart ; j < c ; ++j)
+ if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
+ ++offset;
+
+ os << c + offset << "} ";
+ }
}
}
os << "\n";
os << "\\hline ";
} else {
for (col_type c = 0; c < ncols(); ++c) {
- for ( ; c < ncols() && !bottomline[c]; ++c) {}
-
- col_type offset = 0;
- for (col_type j = 0 ; j < c; ++j)
- if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
- ++offset;
-
- //babel makes the "-" character an active one, so we have to suppress this here
- //see http://groups.google.com/group/comp.text.tex/browse_thread/thread/af769424a4a0f289#
- if (lang == "slovak" || lang == "czech")
- os << "\\expandafter" << (use_booktabs ? "\\cmidrule" : "\\cline")
- << "\\expandafter{\\expandafter" << c + 1 + offset << "\\string-";
- else
- os << (use_booktabs ? "\\cmidrule{" : "\\cline{") << c + 1 + offset << '-';
-
- col_type cstart = c;
- for ( ; c < ncols() && bottomline[c]; ++c) {}
-
- for (col_type j = cstart ; j < c ; ++j)
- if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
- ++offset;
-
- os << c + offset << "} ";
+ if (bottomline[c]) {
+ col_type offset = 0;
+ for (col_type j = 0 ; j < c; ++j)
+ if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
+ ++offset;
+
+ //babel makes the "-" character an active one, so we have to suppress this here
+ //see http://groups.google.com/group/comp.text.tex/browse_thread/thread/af769424a4a0f289#
+ if (lang == "slovak" || lang == "czech")
+ os << "\\expandafter" << (use_booktabs ? "\\cmidrule" : "\\cline")
+ << "\\expandafter{\\expandafter" << c + 1 + offset << "\\string-";
+ else
+ os << (use_booktabs ? "\\cmidrule{" : "\\cline{") << c + 1 + offset << '-';
+
+ col_type cstart = c;
+ for ( ; c < ncols() && bottomline[c]; ++c) {}
+
+ for (col_type j = cstart ; j < c ; ++j)
+ if (column_info[j].alignment == LYX_ALIGN_DECIMAL)
+ ++offset;
+
+ os << c + offset << "} ";
+ }
}
}
os << "\n";
os << from_ascii(getPWidth(cell).asLatexString());
else
// we need to set a default value
- // needs to be discussed
os << "*";
os << "}{";
} // end if ismultirow
case LFUN_CHAR_RIGHT_SELECT:
case LFUN_CHAR_RIGHT:
case LFUN_CHAR_LEFT_SELECT:
- case LFUN_CHAR_LEFT: {
+ case LFUN_CHAR_LEFT:
+ case LFUN_WORD_FORWARD:
+ case LFUN_WORD_FORWARD_SELECT:
+ case LFUN_WORD_BACKWARD:
+ case LFUN_WORD_BACKWARD_SELECT:
+ case LFUN_WORD_RIGHT:
+ case LFUN_WORD_RIGHT_SELECT:
+ case LFUN_WORD_LEFT:
+ case LFUN_WORD_LEFT_SELECT: {
// determine whether we move to next or previous cell, where to enter
// the new cell from, and which command to "finish" (i.e., exit the
// inset) with:
FuncCode finish_lfun;
if (act == LFUN_CHAR_FORWARD
- || act == LFUN_CHAR_FORWARD_SELECT) {
+ || act == LFUN_CHAR_FORWARD_SELECT
+ || act == LFUN_WORD_FORWARD
+ || act == LFUN_WORD_FORWARD_SELECT) {
next_cell = true;
finish_lfun = LFUN_FINISHED_FORWARD;
}
else if (act == LFUN_CHAR_BACKWARD
- || act == LFUN_CHAR_BACKWARD_SELECT) {
+ || act == LFUN_CHAR_BACKWARD_SELECT
+ || act == LFUN_WORD_BACKWARD
+ || act == LFUN_WORD_BACKWARD_SELECT) {
next_cell = false;
finish_lfun = LFUN_FINISHED_BACKWARD;
}
// table's direction.
else {
bool const right = act == LFUN_CHAR_RIGHT
- || act == LFUN_CHAR_RIGHT_SELECT;
+ || act == LFUN_CHAR_RIGHT_SELECT
+ || act == LFUN_WORD_RIGHT
+ || act == LFUN_WORD_RIGHT_SELECT;
next_cell = isRightToLeft(cur) != right;
if (lyxrc.visual_cursor)
finish_lfun = right ? LFUN_FINISHED_RIGHT : LFUN_FINISHED_LEFT;
}
- bool const select = act == LFUN_CHAR_FORWARD_SELECT ||
- act == LFUN_CHAR_BACKWARD_SELECT ||
- act == LFUN_CHAR_RIGHT_SELECT ||
- act == LFUN_CHAR_LEFT_SELECT;
+ bool const select = act == LFUN_CHAR_FORWARD_SELECT
+ || act == LFUN_CHAR_BACKWARD_SELECT
+ || act == LFUN_CHAR_RIGHT_SELECT
+ || act == LFUN_CHAR_LEFT_SELECT
+ || act == LFUN_WORD_FORWARD_SELECT
+ || act == LFUN_WORD_RIGHT_SELECT
+ || act == LFUN_WORD_BACKWARD_SELECT
+ || act == LFUN_WORD_LEFT_SELECT;
// If we have a multicell selection or we're
// not doing some LFUN_*_SELECT thing anyway...
break;
case Tabular::SET_LONGTABULAR:
+ // setting as longtable is not allowed when table is inside a float
+ if (cur.innerInsetOfType(FLOAT_CODE) != 0
+ || cur.innerInsetOfType(WRAP_CODE) != 0)
+ status.setEnabled(false);
status.setOnOff(tabular.is_long_tabular);
break;