]> git.lyx.org Git - lyx.git/blobdiff - src/Spacing.C
hopefully fix tex2lyx linking.
[lyx.git] / src / Spacing.C
index bc9ec91ca5c8743a49eb7e5b3bdddfcc7a804058..35eecde79e0d2b268d4e26fdaa1ea6cb8f9ecb56 100644 (file)
 
 #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;
@@ -45,13 +46,13 @@ string const Spacing::getValueAsString() const
 
 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));
 }
 
 
@@ -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<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;
                }
        }
@@ -129,3 +130,6 @@ string const Spacing::writeEnvirEnd() const
        }
        return string();
 }
+
+
+} // namespace lyx