X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFormParagraph.C;h=a5f36f809618afe07ac452af612ffe5097a24476;hb=d5443737342903de489d527802cd2cdd38987d74;hp=6224a88ffad024fff257b424d94e75022ed94d39;hpb=2a31934f38d624bef25c0b177852233eee9768f0;p=lyx.git diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index 6224a88ffa..a5f36f8096 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -28,7 +28,7 @@ #include "Spacing.h" #include "support/lstrings.h" -#include "support/tostr.h" +#include "support/convert.h" #include "lyx_forms.h" @@ -49,13 +49,6 @@ using support::rtrim; namespace frontend { -namespace { - -string defaultUnit("cm"); - -} // namespace anon - - typedef FormController > base_class; FormParagraph::FormParagraph(Dialog & parent) @@ -106,22 +99,6 @@ void FormParagraph::build() remove_if(units_vec.begin(), units_vec.end(), bind(contains, _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; - } } @@ -266,8 +243,8 @@ void FormParagraph::update() 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, ""); }