#include <config.h>
#include "vspace.h"
-#include "lengthcommon.h"
#include "buffer.h"
-#include "lyxrc.h"
+#include "bufferparams.h"
#include "BufferView.h"
+#include "lengthcommon.h"
#include "lyxtext.h"
-#include "support/LAssert.h"
#include "support/lstrings.h"
-#include <cstdio>
+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 {
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.
}
-LyXGlueLength VSpace::length() const
+LyXGlueLength const & VSpace::length() const
{
return len_;
}
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.