scramble email addresses
[lyx.git] / src / lengthcommon.cpp
blob191eca85ba0e7ee85df8e1dbee545ab69f953e2d
1 /**
2 * \file lengthcommon.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Matthias Ettrich
8 * \author John Levon
10 * Full author contact details are available in file CREDITS.
13 #include <config.h>
15 #include "lengthcommon.h"
17 #include "gettext.h"
20 namespace lyx {
22 using std::string;
24 // I am not sure if "mu" should be possible to select (Lgb)
26 // the latex units
27 char const * const unit_name[] = {
28 "sp", "pt", "bp", "dd", "mm", "pc",
29 "cc", "cm", "in", "ex", "em", "mu",
30 "text%", "col%", "page%", "line%",
31 "theight%", "pheight%", "" };
33 int const num_units = int(sizeof(unit_name) / sizeof(unit_name[0]) - 1);
35 // the LyX gui units
36 char const * const unit_name_gui[] = {
37 N_("sp"), N_("pt"), N_("bp"), N_("dd"), N_("mm"), N_("pc"),
38 N_("cc"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"),
39 N_("Text Width %"), N_("Column Width %"), N_("Page Width %"), N_("Line Width %"),
40 N_("Text Height %"), N_("Page Height %"), "" };
42 Length::UNIT unitFromString(string const & data)
44 int i = 0;
45 while (i < num_units && data != unit_name[i])
46 ++i;
47 return static_cast<Length::UNIT>(i);
51 } // namespace lyx