From 1541a7f75602d9cb5f2945426cd1d2c2a3288854 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Tue, 6 Jul 2010 12:01:09 +0000 Subject: [PATCH] GuiBox.cpp: Remove some unnecessary negated logic. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34780 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiBox.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index a74117ef74..f112998c08 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -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(); -- 2.39.2