]> git.lyx.org Git - lyx.git/blobdiff - src/Spacing.C
fix typo that put too many include paths for most people
[lyx.git] / src / Spacing.C
index 61cf42bbcecc320dcab1feeaa958a914f2dfeaa0..1bbb945f9f48e51ad0f743c3d2c349c9ca4f1f3b 100644 (file)
@@ -1,8 +1,8 @@
 /* This file is part of
- * ====================================================== 
- * 
+ * ======================================================
+ *
  *           LyX, The Document Processor
- *        
+ *
  *           Copyright 1995 Matthias Ettrich
  *           Copyright 1995-2001 The LyX Team.
  *
 using std::ios;
 using std::ostream;
 
-/// how can I put this inside of Spacing (class)
-namespace {
-
-char const * const spacing_string[] = {"single", "onehalf", "double", "other"};
-
-} // namespace anon
+string const Spacing::spacing_string[]
+       = {"single", "onehalf", "double", "other"};
 
-
-float Spacing::getValue() const 
+float Spacing::getValue() const
 {
        switch (space) {
        case Default: // nothing special should happen with this...
@@ -58,8 +53,8 @@ void Spacing::set(Spacing::Space sp, float val)
 
 void Spacing::set(Spacing::Space sp, string const & val)
 {
-       float fval;
-       istringstream istr(val);
+       float fval = 0.0;
+       istringstream istr(val.c_str());
        istr >> fval;
        set(sp, fval);
 }
@@ -68,9 +63,9 @@ void Spacing::set(Spacing::Space sp, string const & val)
 void Spacing::writeFile(ostream & os, bool para) const
 {
        if (space == Default) return;
-       
+
        string cmd = para ? "\\paragraph_spacing " : "\\spacing ";
-       
+
        if (getSpace() == Spacing::Other) {
                os.setf(ios::showpoint|ios::fixed);
                os.precision(2);
@@ -78,7 +73,7 @@ void Spacing::writeFile(ostream & os, bool para) const
                   << " " << getValue() << " \n";
        } else {
                os << cmd << spacing_string[getSpace()] << " \n";
-       }       
+       }
 }