From: Jürgen Spitzmüller Date: Tue, 15 Jul 2003 18:44:49 +0000 (+0000) Subject: QTabularDialog: fix width input (bug 1156) X-Git-Tag: 1.6.10~16538 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bd76214fd4baf901ca64e36fdfe3846a882e41c6;p=features.git QTabularDialog: fix width input (bug 1156) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7286 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 53cc526801..72c02a0058 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2003-07-15 Juergen Spitzmueller + + * QTabular.C: + * QTabularDialog.C: handle clever width input (bug 1156) + 2003-07-15 John Levon * QMathDialog.C: use widget(i) not visibleWidget() due to diff --git a/src/frontends/qt2/QTabular.C b/src/frontends/qt2/QTabular.C index 3c1ed6fede..4dc7e50750 100644 --- a/src/frontends/qt2/QTabular.C +++ b/src/frontends/qt2/QTabular.C @@ -162,13 +162,13 @@ void QTabular::update_contents() dialog_->specialAlignmentED->setEnabled(!isReadonly); LyXLength::UNIT default_unit = controller().useMetricUnits() ? LyXLength::CM : LyXLength::IN; - if (!pwidth.zero()) { - dialog_->widthED->setText(toqstr(tostr(pwidth.value()))); - dialog_->widthUnit->setCurrentItem(pwidth.unit()); - } else { - dialog_->widthED->setText(""); - dialog_->widthUnit->setCurrentItem(default_unit); - } + + string colwidth; + if (!pwidth.zero()) + colwidth = pwidth.asString(); + lengthToWidgets(dialog_->widthED, dialog_->widthUnit, + colwidth, default_unit); + dialog_->widthED->setEnabled(!isReadonly); dialog_->widthUnit->setEnabled(!isReadonly); diff --git a/src/frontends/qt2/QTabularDialog.C b/src/frontends/qt2/QTabularDialog.C index 864c297bc5..8f3f668b7d 100644 --- a/src/frontends/qt2/QTabularDialog.C +++ b/src/frontends/qt2/QTabularDialog.C @@ -112,9 +112,7 @@ void QTabularDialog::specialAlignment_changed() void QTabularDialog::width_changed() { form_->changed(); - string const width = - LyXLength(widthED->text().toDouble(), - widthUnit->currentLengthItem()).asString(); + string const width = widgetsToLength(widthED, widthUnit); form_->controller().setWidth(width); }