From 98eff22b9a1132ca1f9a9256a7959e9ac907255b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 4 Oct 2007 17:35:27 +0000 Subject: [PATCH] remove uneeded code; move some other code to the place where it is used git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20735 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ControlMath.cpp | 21 -------------- src/frontends/controllers/ControlMath.h | 34 ++--------------------- src/frontends/qt4/GuiDelimiter.cpp | 16 +++++++++-- src/mathed/MathExtern.cpp | 16 +++++++---- 4 files changed, 27 insertions(+), 60 deletions(-) diff --git a/src/frontends/controllers/ControlMath.cpp b/src/frontends/controllers/ControlMath.cpp index 3ea06105a9..cf2cb4d29b 100644 --- a/src/frontends/controllers/ControlMath.cpp +++ b/src/frontends/controllers/ControlMath.cpp @@ -150,26 +150,5 @@ std::string const & ControlMath::texName(char_type math_symbol) const } -char const * function_names[] = { - "arccos", "arcsin", "arctan", "arg", "bmod", - "cos", "cosh", "cot", "coth", "csc", "deg", - "det", "dim", "exp", "gcd", "hom", "inf", "ker", - "lg", "lim", "liminf", "limsup", "ln", "log", - "max", "min", "sec", "sin", "sinh", "sup", - "tan", "tanh", "Pr", "" -}; - -int const nr_function_names = sizeof(function_names) / sizeof(char const *) - 1; - -char const * latex_delimiters[] = { - "(", ")", "{", "}", "[", "]", - "lceil", "rceil", "lfloor", "rfloor", "langle", "rangle", - "uparrow", "updownarrow", "Uparrow", "Updownarrow", "downarrow", "Downarrow", - "|", "Vert", "/", "backslash", "" -}; - - -int const nr_latex_delimiters = sizeof(latex_delimiters) / sizeof(char const *); - } // namespace frontend } // namespace lyx diff --git a/src/frontends/controllers/ControlMath.h b/src/frontends/controllers/ControlMath.h index eaec64c238..94322ddd4e 100644 --- a/src/frontends/controllers/ControlMath.h +++ b/src/frontends/controllers/ControlMath.h @@ -12,13 +12,13 @@ #ifndef CONTROLMATH_H #define CONTROLMATH_H - #include "Dialog.h" #include "lfuns.h" // for kb_action #include "Font.h" #include + namespace lyx { namespace frontend { @@ -32,6 +32,7 @@ struct MathSymbol { Font::FONT_FAMILY fontfamily; }; + class ControlMath : public Controller { public: ControlMath(Dialog &); @@ -80,37 +81,6 @@ private: }; -extern char const * function_names[]; -extern int const nr_function_names; -extern char const * latex_arrow[]; -extern int const nr_latex_arrow; -extern char const * latex_bop[]; -extern int const nr_latex_bop; -extern char const * latex_brel[]; -extern int const nr_latex_brel; -extern char const * latex_dots[]; -extern int const nr_latex_dots; -extern char const * latex_greek[]; -extern int const nr_latex_greek; -extern char const * latex_deco[]; -extern int const nr_latex_deco; -extern char const * latex_misc[]; -extern int const nr_latex_misc; -extern char const * latex_varsz[]; -extern int const nr_latex_varsz; -extern char const * latex_ams_misc[]; -extern int const nr_latex_ams_misc; -extern char const * latex_ams_arrows[]; -extern int const nr_latex_ams_arrows; -extern char const * latex_ams_rel[]; -extern int const nr_latex_ams_rel; -extern char const * latex_ams_nrel[]; -extern int const nr_latex_ams_nrel; -extern char const * latex_ams_ops[]; -extern int const nr_latex_ams_ops; -extern char const * latex_delimiters[]; -extern int const nr_latex_delimiters; - } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiDelimiter.cpp b/src/frontends/qt4/GuiDelimiter.cpp index 230c1783b7..91c7915981 100644 --- a/src/frontends/qt4/GuiDelimiter.cpp +++ b/src/frontends/qt4/GuiDelimiter.cpp @@ -27,8 +27,16 @@ using std::string; -namespace lyx { -namespace frontend { +static char const * latex_delimiters[] = { + "(", ")", "{", "}", "[", "]", + "lceil", "rceil", "lfloor", "rfloor", "langle", "rangle", + "uparrow", "updownarrow", "Uparrow", "Updownarrow", "downarrow", "Downarrow", + "|", "Vert", "/", "backslash", "" +}; + + +static int const nr_latex_delimiters = + sizeof(latex_delimiters) / sizeof(char const *); static QString const bigleft[] = {"", "bigl", "Bigl", "biggl", "Biggl"}; @@ -57,6 +65,10 @@ static QString fix_name(QString const & str, bool big) } +namespace lyx { +namespace frontend { + + GuiDelimiterDialog::GuiDelimiterDialog(LyXView & lv) : GuiDialog(lv, "mathdelimiter") { diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index f4190ca978..50d5ab5a9b 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -9,7 +9,7 @@ */ // This file contains most of the magic that extracts "context -// information" from the unstructered layout-oriented stuff in an +// information" from the unstructered layout-oriented stuff in // MathData. #include @@ -36,7 +36,6 @@ #include "support/filetools.h" #include "support/lstrings.h" #include "support/lyxlib.h" -#include "frontends/controllers/ControlMath.h" #include #include @@ -55,8 +54,6 @@ using support::tempName; using support::unlink; using support::subst; -using frontend::function_names; - using std::auto_ptr; using std::endl; using std::find_if; @@ -66,6 +63,15 @@ using std::swap; using std::string; using std::vector; +static char const * function_names[] = { + "arccos", "arcsin", "arctan", "arg", "bmod", + "cos", "cosh", "cot", "coth", "csc", "deg", + "det", "dim", "exp", "gcd", "hom", "inf", "ker", + "lg", "lim", "liminf", "limsup", "ln", "log", + "max", "min", "sec", "sin", "sinh", "sup", + "tan", "tanh", "Pr", 0 +}; + static size_t const npos = lyx::docstring::npos; // define a function for tests @@ -224,7 +230,7 @@ bool extractString(MathAtom const & at, docstring & str) // is this a known function? bool isKnownFunction(docstring const & str) { - for (int i = 0; *function_names[i]; ++i) { + for (int i = 0; function_names[i]; ++i) { if (str == function_names[i]) return true; } -- 2.39.2