3 #include "lengthcommon.h"
8 int const num_units = LyXLength::UNIT_NONE;
10 // I am not sure if "mu" should be possible to select (Lgb)
12 // unit_name is for compatibility. Can be deleted when all works well.
13 // means, when we have full language support for the lengths
14 // in all gui's (Herbert 2002-11-01)
15 char const * unit_name[num_units] = {
16 "sp", "pt", "bp", "dd", "mm", "pc",
17 "cc", "cm", "in", "ex", "em", "mu",
18 "text%", "col%", "page%", "line%",
19 "theight%", "pheight%" };
22 char const * unit_name_ltx[num_units] = {
23 "sp", "pt", "bp", "dd", "mm", "pc",
24 "cc", "cm", "in", "ex", "em", "mu",
25 // in 1.4 the following names should be used. then no
26 // translation into the latex ones are needed
27 // "textheight", "columnwidth", "pagewidth", "linewidth",
28 // "textheight", "pageheight" };
29 "text%", "col%", "page%", "line%",
30 "theight%", "pheight%" };
33 char const * unit_name_gui[num_units] = {
34 N_("sp"), N_("pt"), N_("bp"), N_("dd"), N_("mm"), N_("pc"),
35 N_("cc"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"),
36 N_("text%"), N_("col%"), N_("page%"), N_("line%"),
37 N_("theight%"), N_("pheight%") };
39 // this one maybe better ???? but there can be problems with
41 // N_("textwidth%"), N_("columnwidth%"), N_("pagewidth%"), N_("linewidth%"),
42 // N_("textheight%"), N_("pageheight%") };
44 // or altenative this ones
45 // N_("twidth%"), N_("cwidth%"), N_("pwidth%"), N_("lwidth%"),
46 // N_("theight%"), N_("pheight%") };
48 LyXLength::UNIT unitFromString(string const & data)
51 while (i < num_units && data != unit_name[i])
53 return static_cast<LyXLength::UNIT>(i);