hAlignCO->setEnabled(!(multirowCB->isChecked()
&& !widgetsToLength(columnWidthED, columnWidthUnitLC).empty())
&& specialAlignmentED->text().isEmpty());
+ // decimal alignment is only possible for non-multicol and non-multirow cells
+ if ((multicolumnCB->isChecked() || multirowCB->isChecked())
+ && hAlignCO->findText(qt_("At Decimal Separator")))
+ hAlignCO->removeItem(3);
+ else if (!multicolumnCB->isChecked() && !multirowCB->isChecked()
+ && !hAlignCO->findText(qt_("At Decimal Separator")))
+ hAlignCO->addItem(qt_("At Decimal Separator"), toqstr("decimal"));
bool const dalign =
hAlignCO->itemData(hAlignCO->currentIndex()).toString() == QString("decimal");
decimalPointED->setEnabled(dalign);
captionStatusCB->setEnabled(funcEnabled(Tabular::TOGGLE_LTCAPTION)
&& longtabular);
- multicolumnCB->setEnabled(funcEnabled(Tabular::MULTICOLUMN));
- multirowCB->setEnabled(funcEnabled(Tabular::MULTIROW));
+ multicolumnCB->setEnabled(funcEnabled(Tabular::MULTICOLUMN) && !dalign);
+ multirowCB->setEnabled(funcEnabled(Tabular::MULTIROW) && !dalign);
bool const enable_mr = multirowCB->isChecked();
multirowOffsetLA->setEnabled(enable_mr);
multirowOffsetED->setEnabled(enable_mr);
hAlignCO->addItem(qt_("Right"), toqstr("right"));
if (!multicol && !pwidth.zero())
hAlignCO->addItem(qt_("Justified"), toqstr("justified"));
- if (!multicol)
+ if (!multicol && !multirow)
hAlignCO->addItem(qt_("At Decimal Separator"), toqstr("decimal"));
string align;
}
case LYX_ALIGN_DECIMAL:
{
- if (!multicol)
+ if (!multicol && !multirow)
align = "decimal";
break;
}
break;
case Tabular::ALIGN_DECIMAL:
- setAlign = LYX_ALIGN_DECIMAL;
+ if (tabular.column_info[tabular.cellColumn(cur.idx())].alignment == LYX_ALIGN_DECIMAL)
+ setAlign = LYX_ALIGN_LEFT;
+ else
+ setAlign = LYX_ALIGN_DECIMAL;
break;
case Tabular::M_VALIGN_TOP: