]> git.lyx.org Git - features.git/commitdiff
GuiTabular.cpp: fix #3517
authorUwe Stöhr <uwestoehr@web.de>
Mon, 29 Nov 2010 02:38:29 +0000 (02:38 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Mon, 29 Nov 2010 02:38:29 +0000 (02:38 +0000)
- 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

src/frontends/qt4/GuiTabular.cpp

index b255ab2fc93509e89728a0619c189fae9cfcf947..8ffa2f3146aa16c873521a62a981bf2aa4faf674 100644 (file)
@@ -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);