X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FVSpace.cpp;h=19f6af41a1f638d282263e6f6be1ef01ccdf19a3;hb=f37a1b8aeaf8f3a3a66a22bf0b396f7d1ceca2ff;hp=9003951e912a514ee58e1f827d26950d6d7d98b1;hpb=f407442b39b1f163990f8c35cfc6f62de8dd2210;p=lyx.git diff --git a/src/VSpace.cpp b/src/VSpace.cpp index 9003951e91..19f6af41a1 100644 --- a/src/VSpace.cpp +++ b/src/VSpace.cpp @@ -23,11 +23,14 @@ #include "support/convert.h" #include "support/lstrings.h" +#include "support/lassert.h" + #include using namespace std; using namespace lyx::support; + namespace lyx { namespace { @@ -455,7 +458,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const : "\\vspace{" + len_.asLatexString() + '}'; default: - BOOST_ASSERT(false); + LASSERT(false, /**/); return string(); } } @@ -490,6 +493,24 @@ docstring const VSpace::asGUIName() const } +string VSpace::asHTMLLength() const +{ + string result; + switch (kind_) { + case DEFSKIP: result = "2ex"; break; + case SMALLSKIP: result = "1ex"; break; + case MEDSKIP: result = "3ex"; break; + case BIGSKIP: result = "5ex"; break; + case LENGTH: { + Length tmp = len_.len(); + if (tmp.value() > 0) + result = tmp.asHTMLString(); + } + case VFILL: break; + } + return result; +} + int VSpace::inPixels(BufferView const & bv) const { // Height of a normal line in pixels (zoom factor considered) @@ -519,7 +540,7 @@ int VSpace::inPixels(BufferView const & bv) const return len_.len().inPixels(bv.workWidth()); default: - BOOST_ASSERT(false); + LASSERT(false, /**/); return 0; } }