]> git.lyx.org Git - features.git/commitdiff
GuiBox.cpp, InsetBox.cpp: fix some wrong logic
authorUwe Stöhr <uwestoehr@lyx.org>
Sat, 25 May 2013 13:07:17 +0000 (15:07 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Sat, 25 May 2013 13:07:17 +0000 (15:07 +0200)
- InsetBox.cpp:
 a framebox without inner box and without a width is \fbox
 a framebox with inner box is also \fbox
 a framebox without inner box and with width is \framebox

- GuiBox.cpp: the width checkbox must be checked if there is width

src/frontends/qt4/GuiBox.cpp
src/insets/InsetBox.cpp

index afca9ab5225f08b384c0d58951f565c79ee48f20..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);
index a07df279c3de2e513ad0df7cd0bb8057e15a1d81..30c238671b6d705c48aa8b9ab6eb184995f97c4b 100644 (file)
@@ -317,9 +317,9 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
                os << "\\begin{framed}%\n";
                break;
        case Boxed:
-               if (width_string.empty()) {
-                       os << "\\framebox";
+               if (!width_string.empty()) {
                        if (!params_.inner_box) {
+                               os << "\\framebox";
                                // Special widths, see usrguide sec. 3.5
                                // FIXME UNICODE
                                if (params_.special != "none") {
@@ -331,7 +331,8 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
                                           << ']';
                                if (params_.hor_pos != 'c')
                                        os << "[" << params_.hor_pos << "]";
-                       }
+                       } else
+                               os << "\\fbox";
                } else
                        os << "\\fbox";
                os << "{";