From: Uwe Stöhr Date: Sat, 8 Apr 2017 00:16:05 +0000 (+0200) Subject: GuiDocument.cpp: commit missing part X-Git-Tag: 2.3.0alpha1~100 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e5c313fc3bd294102c63ffed212a769a8c537cc1;p=lyx.git GuiDocument.cpp: commit missing part This should have been committed with the previous commit but failed for an unknown reason. --- diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index ef06817632..433b84c7f1 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -725,6 +725,21 @@ GuiDocument::GuiDocument(GuiView & lv) connect(textLayoutModule->justCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); + connect(textLayoutModule->FormulaIndentCB, SIGNAL(toggled(bool)), + this, SLOT(change_adaptor())); + connect(textLayoutModule->FormulaIndentLE, SIGNAL(textChanged(const QString &)), + this, SLOT(change_adaptor())); + connect(textLayoutModule->FormulaIndentCO, SIGNAL(activated(int)), + this, SLOT(change_adaptor())); + + textLayoutModule->FormulaIndentLE->setValidator(new LengthValidator( + textLayoutModule->FormulaIndentLE)); + // initialize the length validator + bc().addCheckedLineEdit(textLayoutModule->FormulaIndentLE); + + // LaTeX's default for FormulaIndent is 30pt + textLayoutModule->FormulaIndentCO->setCurrentItem(Length::PT); + textLayoutModule->lspacingLE->setValidator(new QDoubleValidator( textLayoutModule->lspacingLE)); textLayoutModule->indentLE->setValidator(new LengthValidator( @@ -1259,20 +1274,6 @@ GuiDocument::GuiDocument(GuiView & lv) this, SLOT(change_adaptor())); connect(mathsModule->allPackagesNotPB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(mathsModule->FormulaIndentGB, SIGNAL(toggled(bool)), - this, SLOT(change_adaptor())); - connect(mathsModule->FormulaIndentLE, SIGNAL(textChanged(const QString &)), - this, SLOT(change_adaptor())); - connect(mathsModule->FormulaIndentCO, SIGNAL(activated(int)), - this, SLOT(change_adaptor())); - - mathsModule->FormulaIndentLE->setValidator(new LengthValidator( - mathsModule->FormulaIndentLE)); - // initialize the length validator - bc().addCheckedLineEdit(mathsModule->FormulaIndentLE); - - // LaTeX's default for FormulaIndent is 30pt - mathsModule->FormulaIndentCO->setCurrentItem(Length::PT); // latex class @@ -2887,15 +2888,15 @@ void GuiDocument::applyView() if (rb->isChecked()) bp_.use_package(it->first, BufferParams::package_off); } - bp_.is_formula_indent = mathsModule->FormulaIndentGB->isChecked(); + bp_.is_formula_indent = textLayoutModule->FormulaIndentCB->isChecked(); // if formulas are indented if (bp_.is_formula_indent) { // fill value if empty to avoid LaTeX errors - if (mathsModule->FormulaIndentLE->text().isEmpty()) - mathsModule->FormulaIndentLE->setText("0"); + if (textLayoutModule->FormulaIndentLE->text().isEmpty()) + textLayoutModule->FormulaIndentLE->setText("0"); HSpace FormulaIndentation = HSpace( - widgetsToLength(mathsModule->FormulaIndentLE, - mathsModule->FormulaIndentCO) + widgetsToLength(textLayoutModule->FormulaIndentLE, + textLayoutModule->FormulaIndentCO) ); bp_.setFormulaIndentation(FormulaIndentation); } @@ -3352,11 +3353,11 @@ void GuiDocument::paramsToDialog() // math if (bp_.is_formula_indent) { - mathsModule->FormulaIndentGB->setChecked(bp_.is_formula_indent); + textLayoutModule->FormulaIndentCB->setChecked(bp_.is_formula_indent); string FormulaIndentation = bp_.getFormulaIndentation().asLyXCommand(); if (!FormulaIndentation.empty()) { - lengthToWidgets(mathsModule->FormulaIndentLE, - mathsModule->FormulaIndentCO, + lengthToWidgets(textLayoutModule->FormulaIndentLE, + textLayoutModule->FormulaIndentCO, FormulaIndentation, default_unit); } }