//
VSpace::VSpace()
- : kind_(NONE), len_(), keep_(false)
+ : kind_(DEFSKIP), len_(), keep_(false)
{}
VSpace::VSpace(string const & data)
- : kind_(NONE), len_(), keep_(false)
+ : kind_(DEFSKIP), len_(), keep_(false)
{
if (data.empty())
return;
{
string result;
switch (kind_) {
- case NONE: break;
case DEFSKIP: result = "defskip"; break;
case SMALLSKIP: result = "smallskip"; break;
case MEDSKIP: result = "medskip"; break;
case VFILL: result = "vfill"; break;
case LENGTH: result = len_.asString(); break;
}
- if (keep_ && kind_ != NONE && kind_ != DEFSKIP)
+ if (keep_)
result += '*';
return result;
}
string const VSpace::asLatexCommand(BufferParams const & params) const
{
switch (kind_) {
- case NONE:
- return string();
-
case DEFSKIP:
return params.getDefSkip().asLatexCommand(params);
case LENGTH:
return keep_ ? "\\vspace*{" + len_.asLatexString() + '}'
: "\\vspace{" + len_.asLatexString() + '}';
+
+ default:
+ BOOST_ASSERT(false);
+ return string();
}
}
switch (kind_) {
- case NONE:
- // value for this is already set
- return 0;
-
case DEFSKIP:
return bv.buffer()->params().getDefSkip().inPixels(bv);
case LENGTH:
return len_.len().inPixels(bv.workWidth());
+
+ default:
+ BOOST_ASSERT(false);
+ return 0;
}
}