- controller().params().type =
- ids_[dialog_->typeCO->currentIndex()];
-
- controller().params().inner_box =
- dialog_->innerBoxCO->currentText() != qt_("None");
- controller().params().use_parbox =
- dialog_->innerBoxCO->currentText() == qt_("Parbox");
-
- controller().params().pos =
- "tcb"[dialog_->valignCO->currentIndex()];
- controller().params().inner_pos =
- "tcbs"[dialog_->ialignCO->currentIndex()];
- controller().params().hor_pos =
- "lcrs"[dialog_->halignCO->currentIndex()];
-
- int i = 0;
- bool spec = false;
- QString special = dialog_->widthUnitsLC->currentText();
- QString value = dialog_->widthED->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;
- }
- 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(dialog_->widthED, dialog_->widthUnitsLC);
-
- controller().params().width = Length(width);
-
- i = 0;
- spec = false;
- special = dialog_->heightUnitsLC->currentText();
- value = dialog_->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;
+ bool pagebreak =
+ pagebreakCB->isEnabled() && pagebreakCB->isChecked();
+ if (pagebreak)
+ params_.type = "Framed";
+ else
+ params_.type = fromqstr(ids_[typeCO->currentIndex()]);
+
+ params_.inner_box =
+ (!pagebreak && innerBoxCO->currentText() != qt_("None"));
+ params_.use_parbox =
+ (!pagebreak && innerBoxCO->currentText() == qt_("Parbox"));
+
+ params_.pos = "tcb"[valignCO->currentIndex()];
+ params_.inner_pos = "tcbs"[ialignCO->currentIndex()];
+ params_.hor_pos = "lcrs"[halignCO->currentIndex()];
+
+ QString unit =
+ widthUnitsLC->itemData(widthUnitsLC->currentIndex()).toString();
+ QString value = widthED->text();
+ 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));