]> git.lyx.org Git - features.git/commitdiff
GuiDocument: fix bug #10653
authorUwe Stöhr <uwestoehr@lyx.org>
Mon, 8 May 2017 23:00:36 +0000 (01:00 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Mon, 8 May 2017 23:00:36 +0000 (01:00 +0200)
- also rename a function because we have the same function name in BufferParams

src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h

index 744229f8ee7a19a5a1b0a83e53c9c6edadb5f5db..e58554be00899554d9944a03c3768f802c84ffb2 100644 (file)
@@ -1268,7 +1268,7 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(mathsModule->MathIndentCO, SIGNAL(activated(int)),
                this, SLOT(change_adaptor()));
        connect(mathsModule->MathIndentCO, SIGNAL(activated(int)),
-               this, SLOT(setMathIndent(int)));
+               this, SLOT(EnableMathIndent(int)));
        connect(mathsModule->MathIndentLE, SIGNAL(textChanged(const QString &)),
                this, SLOT(change_adaptor()));
        connect(mathsModule->MathIndentLengthCO, SIGNAL(activated(int)),
@@ -1630,7 +1630,7 @@ void GuiDocument::allowMathIndent() {
        isValid();
 }
 
-void GuiDocument::setMathIndent(int item)
+void GuiDocument::EnableMathIndent(int item)
 {
        bool const enable = (item == 1);
        mathsModule->MathIndentLE->setEnabled(enable);
@@ -2920,14 +2920,9 @@ void GuiDocument::applyView()
                if (rb->isChecked())
                        bp_.use_package(it->first, BufferParams::package_off);
        }
-       bp_.is_math_indent = mathsModule->MathIndentCB->isChecked();
        // if math is indented
+       bp_.is_math_indent = mathsModule->MathIndentCB->isChecked();
        if (bp_.is_math_indent) {
-               Length mathindent(widgetsToLength(mathsModule->MathIndentLE,
-                                                 mathsModule->MathIndentLengthCO));
-               bp_.setMathIndent(mathindent);
-       }
-       if (mathsModule->MathIndentCB->isChecked()) {
                // if formulas are indented
                switch (mathsModule->MathIndentCO->currentIndex()) {
                case 0:
@@ -3407,8 +3402,8 @@ void GuiDocument::paramsToDialog()
        updateModuleInfo();
 
        // math
+       mathsModule->MathIndentCB->setChecked(bp_.is_math_indent);
        if (bp_.is_math_indent) {
-               mathsModule->MathIndentCB->setChecked(bp_.is_math_indent);
                Length const mathindent = bp_.getMathIndent();
                int indent = 0;
                if (!mathindent.empty()) {
@@ -3418,7 +3413,7 @@ void GuiDocument::paramsToDialog()
                        indent = 1;
                }
                mathsModule->MathIndentCO->setCurrentIndex(indent);
-               setMathIndent(indent);
+               EnableMathIndent(indent);
        }
        if (bp_.math_number_before)
                mathsModule->MathNumberingPosCO->setCurrentIndex(0);
@@ -4091,7 +4086,7 @@ bool GuiDocument::isValid()
                        !textLayoutModule->indentLE->text().isEmpty()
                ) &&
                (
-                       // if we're asking for indentation
+                       // if we're asking for math indentation
                        !mathsModule->MathIndentCB->isChecked() ||
                        // then either we haven't chosen custom
                        mathsModule->MathIndentCO->currentIndex() != 1 ||
index 7527a59edc9cdf857c82ad856993ae2816e70c53..996fb303e0bbbf11f7299eded59b0810b3bab6d3 100644 (file)
@@ -110,7 +110,7 @@ private Q_SLOTS:
        void setSkip(int);
        void enableSkip(bool);
        void allowMathIndent();
-       void setMathIndent(int);
+       void EnableMathIndent(int);
        void browseLayout();
        void browseMaster();
        void classChanged();