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>
* QMathDialog.C: use widget(i) not visibleWidget() due to

View 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);

View 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);
}