From: Uwe Stöhr Date: Sat, 25 May 2013 13:07:17 +0000 (+0200) Subject: GuiBox.cpp, InsetBox.cpp: fix some wrong logic X-Git-Tag: 2.1.0beta1~163 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=427aeff90fdb9ff5a698c73b72240467611c9f04;p=lyx.git GuiBox.cpp, InsetBox.cpp: fix some wrong logic - 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 --- diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index afca9ab522..d3bd8e86c0 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -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); diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index a07df279c3..30c238671b 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -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 << "{";