]> git.lyx.org Git - lyx.git/blob - src/lengthcommon.C
Rob's latest and greatest dialog tweaking.
[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         "theight%", "pheight%" };
13
14
15 LyXLength::UNIT unitFromString(string const & data)
16 {
17         int i = 0;
18         while (i < num_units && data != unit_name[i])
19                 ++i;
20         return static_cast<LyXLength::UNIT>(i);
21 }