#include "Spacing.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include <string>
-using lyx::support::strToDbl;
-//using std::ios;
+namespace lyx {
+
+
using std::ostream;
using std::ostringstream;
using std::string;
double Spacing::getValue() const
{
- return strToDbl(getValueAsString());
+ return convert<double>(getValueAsString());
}
-void Spacing::set(Spacing::Space sp, float val)
+void Spacing::set(Spacing::Space sp, double val)
{
- set(sp, tostr(val));
+ set(sp, convert<string>(val));
}
{
space = sp;
if (sp == Other) {
- switch (int(strToDbl(val) * 1000 + 0.5)) {
- case 1000:
- space = Single;
+ switch (int(convert<double>(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;
}
}
}
return string();
}
+
+
+} // namespace lyx