]> git.lyx.org Git - lyx.git/blobdiff - src/vspace.C
mathed31.diff
[lyx.git] / src / vspace.C
index d12ecb820a497080a57fba93f34d1ffd60d2b6c5..177f62de744aafa76c2bec6fcdbebef8997ceb23 100644 (file)
@@ -50,8 +50,7 @@ static LyXLength::UNIT unit[4]   = { LyXLength::UNIT_NONE,
                                     LyXLength::UNIT_NONE,
                                     LyXLength::UNIT_NONE,
                                     LyXLength::UNIT_NONE };
-//static int number_index, unit_index;
-int number_index, unit_index;
+static int number_index, unit_index;
 
 
 static inline
@@ -249,6 +248,8 @@ bool isValidLength(string const & data, LyXLength * result)
        /// The parser may seem overkill for lengths without 
        /// glue, but since we already have it, using it is
        /// easier than writing something from scratch.
+       if (data.empty())
+               return true;
 
         string   buffer(data);
        int       pattern_index = 0;
@@ -457,16 +458,16 @@ VSpace::VSpace (string const & data)
 
 bool VSpace::operator==(VSpace const & other) const
 {
-       if (this->kin == other.kin) 
-               if (this->kin == LENGTH)
-                       if (this->len == other.len)
-                               return this->kp == other.kp;
-                       else
-                               return false;
-               else
-                       return this->kp == other.kp;
-       else
+       if (this->kin != other.kin)
+               return false;
+       if (this->kin != LENGTH)
+               return this->kp == other.kp;
+       if (!(this->len == other.len))
                return false;
+       return this->kp == other.kp;
 }