From e5c313fc3bd294102c63ffed212a769a8c537cc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sat, 8 Apr 2017 02:16:05 +0200 Subject: [PATCH] GuiDocument.cpp: commit missing part This should have been committed with the previous commit but failed for an unknown reason. --- src/frontends/qt4/GuiDocument.cpp | 45 ++++++++++++++++--------------- 1 file changed, 23 insertions(+), 22 deletions(-) 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); } } -- 2.39.2