]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiBox.cpp
GuiBox.cpp: Remove some unnecessary negated logic.
[features.git] / src / frontends / qt4 / GuiBox.cpp
index a74117ef74897acbc6a9e1574b59857d17d91d40..f112998c08604ec722a51942b7b9a490b20547f6 100644 (file)
@@ -128,10 +128,10 @@ void GuiBox::on_innerBoxCO_activated(int index)
        heightCB->setEnabled(ibox);
        // except for frameless and boxed, the width cannot be specified if
        // there is no inner box
-       bool const width_disabled = (!ibox && outer != "Frameless" &&
-               outer != "Boxed");
-       widthED->setEnabled(!width_disabled);
-       widthUnitsLC->setEnabled(!width_disabled);
+       bool const width_enabled =
+               ibox || outer == "Frameless" || outer == "Boxed";
+       widthED->setEnabled(width_enabled);
+       widthUnitsLC->setEnabled(width_enabled);
        // halign is only allowed for Boxed without inner box or for makebox
        halignCO->setEnabled((!ibox && outer == "Boxed")
                || (itype == "makebox"));
@@ -167,10 +167,10 @@ void GuiBox::on_typeCO_activated(int index)
        }
        // except for frameless and boxed, the width cannot be specified if
        // there is no inner box
-       bool const width_disabled = (itype == "none" && !frameless
-               && type != "Boxed");
-       widthED->setEnabled(!width_disabled);
-       widthUnitsLC->setEnabled(!width_disabled);
+       bool const width_enabled = 
+               itype != "none" || frameless || type == "Boxed";
+       widthED->setEnabled(width_enabled);
+       widthUnitsLC->setEnabled(width_enabled);
        // halign is only allowed for Boxed without inner box or for makebox
        halignCO->setEnabled((type == "Boxed" && itype == "none") || (itype == "makebox"));
        // pagebreak is only allowed for Boxed without inner box
@@ -264,10 +264,9 @@ void GuiBox::paramsToDialog(Inset const * inset)
 
        // except for frameless and boxed, the width cannot be specified if
        // there is no inner box
-       bool const width_disabled = (!ibox && !frameless
-               && type != "Boxed");
-       widthED->setEnabled(!width_disabled);
-       widthUnitsLC->setEnabled(!width_disabled);
+       bool const width_enabled = (ibox || frameless || type == "Boxed");
+       widthED->setEnabled(width_enabled);
+       widthUnitsLC->setEnabled(width_enabled);
 
        Length::UNIT const default_unit = Length::defaultUnit();