col_type const j = cellColumn(cell);
column_info[j].p_width = width;
+ // reset the vertical alignment to top if the fixed with
+ // is removed or zero because only fixed width columns can
+ // have a vertical alignment
+ if (column_info[j].p_width.zero())
+ column_info[j].valignment = LYX_VALIGN_TOP;
for (row_type i = 0; i < row_info.size(); ++i) {
idx_type const cell = cellIndex(i, j);
// because of multicolumns
case Tabular::MULTICOLUMN:
// If a row is set as longtable caption, it must not be allowed
// to unset that this row is a multicolumn.
+ // don't allow to set a multirow as multicolumn
status.setEnabled(sel_row_start == sel_row_end
- && !tabular.ltCaption(tabular.cellRow(cur.idx())));
+ && !tabular.ltCaption(tabular.cellRow(cur.idx()))
+ && !tabular.isMultiRow(cur.idx()) );
status.setOnOff(tabular.isMultiColumn(cur.idx()));
break;
case Tabular::MULTIROW:
// If a row is set as longtable caption, it must not be allowed
// to unset that this row is a multirow.
+ // don't allow to set a multicolumn as multirow
status.setEnabled(sel_col_start == sel_col_end
- && !tabular.ltCaption(tabular.cellRow(cur.idx())));
+ && !tabular.ltCaption(tabular.cellRow(cur.idx()))
+ && !tabular.isMultiColumn(cur.idx()) );
status.setOnOff(tabular.isMultiRow(cur.idx()));
break;
case Tabular::M_VALIGN_TOP:
flag = false;
case Tabular::VALIGN_TOP:
+ status.setEnabled(!tabular.getPWidth(cur.idx()).zero());
status.setOnOff(
tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_TOP);
break;
case Tabular::M_VALIGN_BOTTOM:
flag = false;
case Tabular::VALIGN_BOTTOM:
+ status.setEnabled(!tabular.getPWidth(cur.idx()).zero());
status.setOnOff(
tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_BOTTOM);
break;
case Tabular::M_VALIGN_MIDDLE:
flag = false;
case Tabular::VALIGN_MIDDLE:
+ status.setEnabled(!tabular.getPWidth(cur.idx()).zero());
status.setOnOff(
tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_MIDDLE);
break;
break;
// only one row can be the caption
+ // and a multirow cannot be set as caption
case Tabular::TOGGLE_LTCAPTION:
status.setEnabled(sel_row_start == sel_row_end
&& !tabular.getRowOfLTFirstHead(sel_row_start, dummyltt)
&& !tabular.getRowOfLTFoot(sel_row_start, dummyltt)
&& !tabular.getRowOfLTLastFoot(sel_row_start, dummyltt)
&& (!tabular.haveLTCaption()
- || tabular.ltCaption(sel_row_start)));
+ || tabular.ltCaption(sel_row_start))
+ && !tabular.isMultiRow(sel_row_start));
status.setOnOff(tabular.ltCaption(sel_row_start));
break;