QTabularDialog: fix width input (bug 1156)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7286 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2003-07-15 18:44:49 +00:00
parent cd12251e27
commit bd76214fd4
3 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2003-07-15 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* QTabular.C:
* QTabularDialog.C: handle clever width input (bug 1156)
2003-07-15 John Levon <levon@movementarian.org> 2003-07-15 John Levon <levon@movementarian.org>
* QMathDialog.C: use widget(i) not visibleWidget() due to * QMathDialog.C: use widget(i) not visibleWidget() due to

View File

@ -162,13 +162,13 @@ void QTabular::update_contents()
dialog_->specialAlignmentED->setEnabled(!isReadonly); dialog_->specialAlignmentED->setEnabled(!isReadonly);
LyXLength::UNIT default_unit = controller().useMetricUnits() ? LyXLength::CM : LyXLength::IN; LyXLength::UNIT default_unit = controller().useMetricUnits() ? LyXLength::CM : LyXLength::IN;
if (!pwidth.zero()) {
dialog_->widthED->setText(toqstr(tostr(pwidth.value()))); string colwidth;
dialog_->widthUnit->setCurrentItem(pwidth.unit()); if (!pwidth.zero())
} else { colwidth = pwidth.asString();
dialog_->widthED->setText(""); lengthToWidgets(dialog_->widthED, dialog_->widthUnit,
dialog_->widthUnit->setCurrentItem(default_unit); colwidth, default_unit);
}
dialog_->widthED->setEnabled(!isReadonly); dialog_->widthED->setEnabled(!isReadonly);
dialog_->widthUnit->setEnabled(!isReadonly); dialog_->widthUnit->setEnabled(!isReadonly);

View File

@ -112,9 +112,7 @@ void QTabularDialog::specialAlignment_changed()
void QTabularDialog::width_changed() void QTabularDialog::width_changed()
{ {
form_->changed(); form_->changed();
string const width = string const width = widgetsToLength(widthED, widthUnit);
LyXLength(widthED->text().toDouble(),
widthUnit->currentLengthItem()).asString();
form_->controller().setWidth(width); form_->controller().setWidth(width);
} }