]> git.lyx.org Git - lyx.git/blob - src/lengthcommon.C
docbook:
[lyx.git] / src / lengthcommon.C
1 #include <config.h>
2
3 #include "lengthcommon.h"
4
5 int const num_units = LyXLength::UNIT_NONE;
6
7 // I am not sure if "mu" should be possible to select (Lgb)
8 char const * unit_name[num_units] = { 
9         "sp", "pt", "bp", "dd", "mm", "pc", "cc", "cm",
10         "in", "ex", "em", "mu", 
11         "text%",  "col%", "page%", "line%" };
12
13
14 LyXLength::UNIT unitFromString(string const & data)
15 {
16         int i = 0;
17         while (i < num_units && data != unit_name[i])
18                 ++i;
19         return static_cast<LyXLength::UNIT>(i);
20 }