#include "buffer.h"
#include "bufferparams.h"
#include "BufferView.h"
+#include "gettext.h"
#include "lengthcommon.h"
#include "lyxtext.h"
+#include "support/convert.h"
#include "support/lstrings.h"
using lyx::support::compare;
using lyx::support::ltrim;
using lyx::support::prefixIs;
using lyx::support::rtrim;
-using lyx::support::strToDbl;
using std::string;
lyx_advance(data, i);
if (isStrDbl(buffer)) {
- number[number_index] = strToDbl(buffer);
+ number[number_index] = convert<double>(buffer);
++number_index;
return 'n';
}
const char * stringFromUnit(int unit)
{
- if (unit < 0 || unit >= num_units)
+ if (unit < 0 || unit > num_units)
return 0;
return unit_name[unit];
}
// without units in added_space_top/bottom.
// Let unit default to centimeters here.
kind_ = LENGTH;
- len_ = LyXGlueLength(LyXLength(strToDbl(input), LyXLength::CM));
+ len_ = LyXGlueLength(LyXLength(convert<double>(input), LyXLength::CM));
}
}
}
+string const VSpace::asGUIName() const
+{
+ string result;
+ switch (kind_) {
+ case DEFSKIP:
+ result = _("Default skip");
+ break;
+ case SMALLSKIP:
+ result = _("Small skip");
+ break;
+ case MEDSKIP:
+ result = _("Medium skip");
+ break;
+ case BIGSKIP:
+ result = _("Big skip");
+ break;
+ case VFILL:
+ result = _("Vertical fill");
+ break;
+ case LENGTH:
+ result = len_.asString();
+ break;
+ }
+ if (keep_)
+ result += ", " + _("protected");
+ return result;
+}
+
int VSpace::inPixels(BufferView const & bv) const
{