]> git.lyx.org Git - lyx.git/blobdiff - src/vspace.C
ws changes only
[lyx.git] / src / vspace.C
index 2fe08c4e1b403abe0aa4ea29465ba5d03a53ea34..a3b8c5a41a3d314b0c3fb77513252642f2483bf1 100644 (file)
 #include <config.h>
 
 #include "vspace.h"
-#include "lengthcommon.h"
 #include "buffer.h"
+#include "bufferparams.h"
 #include "BufferView.h"
+#include "lengthcommon.h"
 #include "lyxtext.h"
 
 #include "support/lstrings.h"
 
+using lyx::support::compare;
+using lyx::support::isStrDbl;
+using lyx::support::ltrim;
+using lyx::support::prefixIs;
+using lyx::support::rtrim;
+using lyx::support::strToDbl;
 
-using namespace lyx::support;
+using std::string;
 
-#ifndef CXX_GLOBAL_CSTD
-using std::sscanf;
-#endif
 
 namespace {
 
@@ -357,7 +361,8 @@ VSpace::VSpace(string const & data)
        else if (prefixIs (input, "bigskip"))    kind_ = BIGSKIP;
        else if (prefixIs (input, "vfill"))      kind_ = VFILL;
        else if (isValidGlueLength(input, &len_)) kind_ = LENGTH;
-       else if (sscanf(input.c_str(), "%lf", &value) == 1) {
+       else if (isStrDbl(input)) {
+               value = strToDbl(input);
                // This last one is for reading old .lyx files
                // without units in added_space_top/bottom.
                // Let unit default to centimeters here.
@@ -373,7 +378,7 @@ VSpace::vspace_kind VSpace::kind() const
 }
 
 
-LyXGlueLength VSpace::length() const
+LyXGlueLength const & VSpace::length() const
 {
        return len_;
 }
@@ -480,7 +485,7 @@ int VSpace::inPixels(BufferView const & bv) const
                break;
 
        case DEFSKIP:
-               retval = bv.buffer()->params.getDefSkip().inPixels(bv);
+               retval = bv.buffer()->params().getDefSkip().inPixels(bv);
                break;
 
        // This is how the skips are normally defined by LateX.