From bd76214fd4baf901ca64e36fdfe3846a882e41c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 15 Jul 2003 18:44:49 +0000 Subject: [PATCH] QTabularDialog: fix width input (bug 1156) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7286 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/QTabular.C | 14 +++++++------- src/frontends/qt2/QTabularDialog.C | 4 +--- 3 files changed, 13 insertions(+), 10 deletions(-) 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); } -- 2.39.2