]> git.lyx.org Git - lyx.git/blobdiff - src/vspace.C
more cursor dispatch
[lyx.git] / src / vspace.C
index 2c9e4a9074169c07ff5be13cbe724d6c098c392f..030af3d6473ef894648891b927dda3ada10df140 100644 (file)
@@ -337,7 +337,7 @@ bool isValidLength(string const & data, LyXLength * result)
 //
 
 VSpace::VSpace()
-       : kind_(NONE), len_(), keep_(false)
+       : kind_(DEFSKIP), len_(), keep_(false)
 {}
 
 
@@ -357,7 +357,7 @@ VSpace::VSpace(LyXGlueLength const & l)
 
 
 VSpace::VSpace(string const & data)
-       : kind_(NONE), len_(), keep_(false)
+       : kind_(DEFSKIP), len_(), keep_(false)
 {
        if (data.empty())
                return;
@@ -436,7 +436,6 @@ string const VSpace::asLyXCommand() const
 {
        string result;
        switch (kind_) {
-       case NONE:      break;
        case DEFSKIP:   result = "defskip";      break;
        case SMALLSKIP: result = "smallskip";    break;
        case MEDSKIP:   result = "medskip";      break;
@@ -444,7 +443,7 @@ string const VSpace::asLyXCommand() const
        case VFILL:     result = "vfill";        break;
        case LENGTH:    result = len_.asString(); break;
        }
-       if (keep_ && kind_ != NONE && kind_ != DEFSKIP)
+       if (keep_)
                result += '*';
        return result;
 }
@@ -453,9 +452,6 @@ string const VSpace::asLyXCommand() const
 string const VSpace::asLatexCommand(BufferParams const & params) const
 {
        switch (kind_) {
-       case NONE:
-               return string();
-
        case DEFSKIP:
                return params.getDefSkip().asLatexCommand(params);
 
@@ -474,6 +470,10 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
        case LENGTH: 
                return keep_ ? "\\vspace*{" + len_.asLatexString() + '}'
                        : "\\vspace{" + len_.asLatexString() + '}';
+
+       default:
+               BOOST_ASSERT(false);
+               return string();
        }
 }
 
@@ -486,10 +486,6 @@ int VSpace::inPixels(BufferView const & bv) const
 
        switch (kind_) {
 
-       case NONE:
-               // value for this is already set
-               return 0;
-
        case DEFSKIP:
                return bv.buffer()->params().getDefSkip().inPixels(bv);
 
@@ -510,5 +506,9 @@ int VSpace::inPixels(BufferView const & bv) const
 
        case LENGTH:
                return len_.len().inPixels(bv.workWidth());
+
+       default:
+               BOOST_ASSERT(false);
+               return 0;
        }
 }