]> git.lyx.org Git - features.git/commitdiff
GuiBox.cpp: Remove some unnecessary negated logic.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 6 Jul 2010 12:01:09 +0000 (12:01 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 6 Jul 2010 12:01:09 +0000 (12:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34780 a592a061-630c-0410-9148-cb99ea01b6c8

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();