#include "Spacing.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
namespace frontend {
-namespace {
-
-string defaultUnit("cm");
-
-} // namespace anon
-
-
typedef FormController<ControlParagraph, FormView<FD_paragraph> > base_class;
FormParagraph::FormParagraph(Dialog & parent)
remove_if(units_vec.begin(), units_vec.end(),
bind(contains<char>, _1, '%'));
units_vec.erase(del, units_vec.end());
-
- // set default unit for custom length
- switch (lyxrc.default_papersize) {
- case PAPER_DEFAULT:
- case PAPER_USLETTER:
- case PAPER_LEGALPAPER:
- case PAPER_EXECUTIVEPAPER:
- defaultUnit = "in";
- break;
- case PAPER_A3PAPER:
- case PAPER_A4PAPER:
- case PAPER_A5PAPER:
- case PAPER_B5PAPER:
- defaultUnit = "cm";
- break;
- }
}
bool const spacing_other = space.getSpace() == Spacing::Other;
setEnabled(dialog_->input_linespacing, spacing_other);
if (spacing_other) {
- string const sp = tostr(space.getValue());
- fl_set_input(dialog_->input_linespacing, sp.c_str());
+ fl_set_input(dialog_->input_linespacing,
+ space.getValueAsString().c_str());
} else {
fl_set_input(dialog_->input_linespacing, "");
}