]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlength.C
More ascii-export fixes and when making copy of single tabular cells now the
[lyx.git] / src / lyxlength.C
index de47765b932238ab903ad595036697c58ba19eac..c1e08dd4448746a8036f8495098470712d3a351c 100644 (file)
 
 #include <cstdlib>
 
-#if 0
-namespace {
-// this is now here and in lyxgluelength.C
-
-int const num_units = LyXLength::UNIT_NONE;
-
-// I am not sure if "mu" should be possible to select (Lgb)
-char const * unit_name[num_units] = { "sp", "pt", "bp", "dd",
-                                     "mm", "pc", "cc", "cm",
-                                     "in", "ex", "em", "mu",
-                                     "%",  "c%", "p%", "l%" };
-
-
-LyXLength::UNIT unitFromString(string const & data)
-{
-       int i = 0;
-       while (i < num_units && data != unit_name[i])
-               ++i;
-       return static_cast<LyXLength::UNIT>(i);
-}
-
-}
-#endif
-
 
 LyXLength::LyXLength()
        : val_(0), unit_(LyXLength::PT)
@@ -57,6 +33,7 @@ LyXLength::LyXLength(double v, LyXLength::UNIT u)
 
 
 LyXLength::LyXLength(string const & data)
+       : val_(0), unit_(LyXLength::PT)
 {
        LyXLength tmp;
        
@@ -135,3 +112,10 @@ bool operator==(LyXLength const & l1, LyXLength const & l2)
 {
        return l1.value() == l2.value() && l1.unit() == l2.unit();
 }
+
+
+bool operator!=(LyXLength const & l1, LyXLength const & l2)
+{
+       return !(l1 == l2);
+}
+