]> git.lyx.org Git - features.git/commitdiff
QTabularDialog: fix width input (bug 1156)
authorJürgen Spitzmüller <spitz@lyx.org>
Tue, 15 Jul 2003 18:44:49 +0000 (18:44 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Tue, 15 Jul 2003 18:44:49 +0000 (18:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7286 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QTabular.C
src/frontends/qt2/QTabularDialog.C

index 53cc526801ea5a1f70a6fcd2336008ea242e4d90..72c02a00587c5a2d1075d735a2f30996780d3f62 100644 (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>
 
        * QMathDialog.C: use widget(i) not visibleWidget() due to
index 3c1ed6fede7802fa67965396f4b189dd3ca1a597..4dc7e50750803d637fc41fef93ea4d3cc2056f40 100644 (file)
@@ -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);
 
index 864c297bc5b815d2be082bd87da883d4394520be..8f3f668b7d5f71f1c095038c5aea45c9aa36aa58 100644 (file)
@@ -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);
 }