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
This commit is contained in:
Uwe Stöhr 2013-05-25 15:07:17 +02:00
parent 92a2e17903
commit 427aeff90f
2 changed files with 6 additions and 6 deletions

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

View 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 << "{";