- if (special == qt_("Height")) {
- i = 1;
- spec = true;
- } else if (special == qt_("Depth")) {
- i = 2;
- spec = true;
- } else if (special == qt_("Total Height")) {
- i = 3;
- spec = true;
- } else if (special == qt_("Width")) {
- i = 4;
- spec = true;
- }
- // the user might insert a non-special value in the line edit
- if (isValidLength(fromqstr(value))) {
- i = 0;
- spec = false;
- }
- controller().params().special = ids_spec_[i];
-
- string width;
- if (spec) {
- width = fromqstr(value);
- // beware: bogosity! the unit is simply ignored in this case
- width += "in";
- } else
- width = widgetsToLength(widthED, widthUnitsLC);
-
- controller().params().width = Length(width);
-
- i = 0;
- spec = false;
- special = heightUnitsLC->currentText();
- value = heightED->text();
- if (special == qt_("Height")) {
- i = 1;
- spec = true;
- } else if (special == qt_("Depth")) {
- i = 2;
- spec = true;
- } else if (special == qt_("Total Height")) {
- i = 3;
- spec = true;
- } else if (special == qt_("Width")) {
- i = 4;
- spec = true;
- }
- // the user might insert a non-special value in the line edit
- if (isValidLength(fromqstr(value))) {
- i = 0;
- spec = false;
+ if (ids_spec_.contains(unit) && !isValidLength(fromqstr(value))) {
+ params_.special = fromqstr(unit);
+ // Note: the unit is simply ignored in this case
+ params_.width = Length(value.toDouble(), Length::IN);
+ } else {
+ params_.special = "none";
+ params_.width = Length(widgetsToLength(widthED, widthUnitsLC));