From: Uwe Stöhr Date: Mon, 29 Nov 2010 02:38:29 +0000 (+0000) Subject: GuiTabular.cpp: fix #3517 X-Git-Tag: 2.0.0~1638 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d80053cda86767a3c29c231fbb75800492ad5ff2;p=features.git GuiTabular.cpp: fix #3517 - disable column alignment and width if there is a LaTeX argument - use also for the LaTeX argument the editingFinished method (as for all other edit fields in the dialog) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36566 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp index b255ab2fc9..8ffa2f3146 100644 --- a/src/frontends/qt4/GuiTabular.cpp +++ b/src/frontends/qt4/GuiTabular.cpp @@ -130,7 +130,7 @@ GuiTabular::GuiTabular(QWidget * parent) this, SLOT(checkEnabled())); connect(captionStatusCB, SIGNAL(clicked()), this, SLOT(checkEnabled())); - connect(specialAlignmentED, SIGNAL(textEdited(QString)), + connect(specialAlignmentED, SIGNAL(editingFinished()), this, SLOT(checkEnabled())); connect(widthED, SIGNAL(editingFinished()), this, SLOT(checkEnabled())); @@ -159,7 +159,6 @@ GuiTabular::GuiTabular(QWidget * parent) connect(rightRB, SIGNAL(clicked()), this, SLOT(checkEnabled())); - // initialize the length validator addCheckedWidget(widthED, fixedWidthColLA); addCheckedWidget(multirowOffsetED, multirowOffsetLA); @@ -171,17 +170,22 @@ GuiTabular::GuiTabular(QWidget * parent) void GuiTabular::checkEnabled() { + // if there is a LaTeX argument, the width and alignment will be overwrtitten + // therefore disable them in this case + widthED->setEnabled(specialAlignmentED->text().isEmpty()); // if the column has a width, multirows are always left-aligned // therefore disable hAlignCB in this case hAlignCB->setEnabled(!(multirowCB->isChecked() - && !widgetsToLength(widthED, widthUnitCB).empty())); + && !widgetsToLength(widthED, widthUnitCB).empty()) + && specialAlignmentED->text().isEmpty()); bool dalign = hAlignCB->itemData(hAlignCB->currentIndex()).toString() == QString("decimal"); decimalPointLE->setEnabled(dalign); decimalL->setEnabled(dalign); vAlignCB->setEnabled(!multirowCB->isChecked() - && !widgetsToLength(widthED, widthUnitCB).empty()); + && !widgetsToLength(widthED, widthUnitCB).empty() + && specialAlignmentED->text().isEmpty()); topspaceED->setEnabled(topspaceCO->currentIndex() == 2); topspaceUnitCB->setEnabled(topspaceCO->currentIndex() == 2);