- if (fl_get_choice (dialog_->choice_space_above) != 7)
- fl_set_input (dialog_->input_space_above, "");
-
- if (fl_get_choice (dialog_->choice_space_below) != 7)
- fl_set_input (dialog_->input_space_below, "");
-
- if (fl_get_choice (dialog_->choice_linespacing) == 4)
- setEnabled (dialog_->input_linespacing, true);
- else {
- setEnabled (dialog_->input_linespacing, false);
- fl_set_input (dialog_->input_linespacing, "");
+ if (ob == dialog_->choice_space_above) {
+ if (fl_get_choice (dialog_->choice_space_above) != 7) {
+ fl_set_input (dialog_->input_space_above, "");
+ setEnabled (dialog_->input_space_above, false);
+ setEnabled (dialog_->choice_value_space_above, false);
+ } else {
+ setEnabled (dialog_->input_space_above, !lv_->buffer()->isReadonly());
+ setEnabled (dialog_->choice_value_space_above, !lv_->buffer()->isReadonly());
+ bool const metric = lyxrc.default_papersize > 3;
+ int const default_unit = metric ? 8 : 9;
+ if (strip(fl_get_input(dialog_->input_space_above)).empty())
+ fl_set_choice(dialog_->choice_value_space_above,
+ default_unit);
+ }
+ }
+ if (ob == dialog_->choice_space_below) {
+ if (fl_get_choice (dialog_->choice_space_below) != 7) {
+ fl_set_input (dialog_->input_space_below, "");
+ setEnabled (dialog_->input_space_below, false);
+ setEnabled (dialog_->choice_value_space_below, false);
+ } else {
+ setEnabled (dialog_->input_space_below, !lv_->buffer()->isReadonly());
+ setEnabled (dialog_->choice_value_space_below, !lv_->buffer()->isReadonly());
+ bool const metric = lyxrc.default_papersize > 3;
+ int const default_unit = metric ? 8 : 9;
+ if (strip(fl_get_input(dialog_->input_space_below)).empty())
+ fl_set_choice(dialog_->choice_value_space_below,
+ default_unit);
+ }