]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiBox.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiBox.cpp
index 90f5659439dfb2a9eb7ef68fd581d24fc4f98a38..d3bd8e86c06320a6b4dc7db3698f0fd05071db68 100644 (file)
@@ -128,7 +128,7 @@ void GuiBox::on_innerBoxCO_activated(int /* index */)
        // the width can only be selected for makebox or framebox
        widthCB->setEnabled(itype == "makebox"
                            || (outer == "Boxed" && itype == "none"));
-       widthCB->setChecked(itype != "none" && !widthCB->isEnabled());
+       widthCB->setChecked(!widthED->text().isEmpty());
        // except for frameless and boxed, the width cannot be specified if
        // there is no inner box
        bool const width_enabled =
@@ -313,8 +313,7 @@ void GuiBox::paramsToDialog(Inset const * inset)
                lengthToWidgets(widthED, widthUnitsLC,
                        params.width, default_unit);
        } else {
-               if (widthCB->isEnabled())
-                       widthCB->setChecked(true);
+               widthCB->setChecked(true);
                lengthToWidgets(widthED, widthUnitsLC,
                        params.width, default_unit);
                QString const special = toqstr(params.special);
@@ -378,6 +377,9 @@ docstring GuiBox::dialogToParams() const
                        params.width = Length(value.toDouble(), Length::IN);
                } else {
                        params.special = "none";
+                       // we must specify a valid length in this case
+                       if (value.isEmpty())
+                               widthED->setText("0");
                        params.width = Length(widgetsToLength(widthED, widthUnitsLC));
                }
        } else {