]> git.lyx.org Git - features.git/blobdiff - src/Spacing.h
some new (not extensive) changes, some fixes, will probably reverto to .la libs later...
[features.git] / src / Spacing.h
index 50ecc64daa2849e8e4be4772144913f250d404f3..4ee1b284c075516ba672fdbc406b947af02f46a5 100644 (file)
 #ifndef SPACING_H
 #define SPACING_H
 
-#include <cstdio>
-#include "support/LOstream.h"
+#ifdef HAVE_SSTREAM
+#include <sstream>
+using std::istringstream;
+#else
+#include <strstream>
+#endif
 
+#include "support/LOstream.h"
 
 ///
 class Spacing {
@@ -69,7 +74,12 @@ public:
        void set(Spacing::Space sp, char const * val)
        {
                float fval;
-               sscanf(val, "%f", &fval);
+#ifdef HAVE_SSTREAM
+               istringstream istr(val);
+#else
+               istrstream istr(val);
+#endif
+               istr >> fval;
                set(sp, fval);
        }
        ///