]> git.lyx.org Git - lyx.git/blobdiff - src/vspace.C
fix reading the author field.
[lyx.git] / src / vspace.C
index 84bcbc845e5f89c3060f4f528e9a5cf9a18828ba..906bc3432ce0b3753c1b7595d6854d401dc573c2 100644 (file)
@@ -83,12 +83,12 @@ char nextToken(string & data)
                lyx_advance(data, 1);
                return '+';
        }
-               
+
        if (prefixIs(data, "plus")) {
                lyx_advance(data, 4);
                return '+';
        }
-       
+
        if (data[0] == '-') {
                lyx_advance(data, 1);
                return '-';
@@ -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;
 }
@@ -468,13 +467,10 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
        case VFILL:
                return keep_ ? "\\vspace*{\\fill}" : "\\vfill{}";
 
-       case LENGTH: 
+       case LENGTH:
                return keep_ ? "\\vspace*{" + len_.asLatexString() + '}'
                        : "\\vspace{" + len_.asLatexString() + '}';
 
-       case NONE:
-               return string();
-
        default:
                BOOST_ASSERT(false);
                return string();
@@ -486,7 +482,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
 int VSpace::inPixels(BufferView const & bv) const
 {
        // Height of a normal line in pixels (zoom factor considered)
-       int const default_height = defaultRowHeight(); 
+       int const default_height = defaultRowHeight();
 
        switch (kind_) {
 
@@ -511,9 +507,6 @@ int VSpace::inPixels(BufferView const & bv) const
        case LENGTH:
                return len_.len().inPixels(bv.workWidth());
 
-       case NONE:
-               return 0;
-
        default:
                BOOST_ASSERT(false);
                return 0;