X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FSpacing.C;h=35eecde79e0d2b268d4e26fdaa1ea6cb8f9ecb56;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=bc9ec91ca5c8743a49eb7e5b3bdddfcc7a804058;hpb=701b99ecd70ac472aa53c8b2317af44def4f9670;p=lyx.git diff --git a/src/Spacing.C b/src/Spacing.C index bc9ec91ca5..35eecde79e 100644 --- a/src/Spacing.C +++ b/src/Spacing.C @@ -13,14 +13,15 @@ #include "Spacing.h" #include "support/lstrings.h" -#include "support/tostr.h" +#include "support/convert.h" #include #include -using lyx::support::strToDbl; -//using std::ios; +namespace lyx { + + using std::ostream; using std::ostringstream; using std::string; @@ -45,13 +46,13 @@ string const Spacing::getValueAsString() const double Spacing::getValue() const { - return strToDbl(getValueAsString()); + return convert(getValueAsString()); } -void Spacing::set(Spacing::Space sp, float val) +void Spacing::set(Spacing::Space sp, double val) { - set(sp, tostr(val)); + set(sp, convert(val)); } @@ -59,18 +60,18 @@ void Spacing::set(Spacing::Space sp, string const & val) { space = sp; if (sp == Other) { - switch (int(strToDbl(val) * 1000 + 0.5)) { - case 1000: - space = Single; + switch (int(convert(val) * 1000 + 0.5)) { + case 1000: + space = Single; break; - case 1250: - space = Onehalf; + case 1250: + space = Onehalf; break; - case 1667: - space = Double; + case 1667: + space = Double; break; - default: - value = val; + default: + value = val; break; } } @@ -129,3 +130,6 @@ string const Spacing::writeEnvirEnd() const } return string(); } + + +} // namespace lyx