(qtabular width input)
http://bugzilla.lyx.org/show_bug.cgi?id=1156

OK to apply?

Juergen.
Index: src/frontends/qt2/QTabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QTabular.C,v
retrieving revision 1.22
diff -u -r1.22 QTabular.C
--- src/frontends/qt2/QTabular.C	12 Jun 2003 11:52:43 -0000	1.22
+++ src/frontends/qt2/QTabular.C	15 Jul 2003 13:53:17 -0000
@@ -162,13 +162,13 @@
 	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: src/frontends/qt2/QTabularDialog.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QTabularDialog.C,v
retrieving revision 1.12
diff -u -r1.12 QTabularDialog.C
--- src/frontends/qt2/QTabularDialog.C	27 Apr 2003 16:40:50 -0000	1.12
+++ src/frontends/qt2/QTabularDialog.C	15 Jul 2003 13:53:17 -0000
@@ -112,9 +112,7 @@
 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);
 }
 

Reply via email to