]> git.lyx.org Git - lyx.git/commitdiff
remove uneeded code;
authorAndré Pönitz <poenitz@gmx.net>
Thu, 4 Oct 2007 17:35:27 +0000 (17:35 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 4 Oct 2007 17:35:27 +0000 (17:35 +0000)
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
src/frontends/controllers/ControlMath.h
src/frontends/qt4/GuiDelimiter.cpp
src/mathed/MathExtern.cpp

index 3ea06105a938c45262deadeb33812f990c51396a..cf2cb4d29be7b768efdb638e9219e858e0c2cc1c 100644 (file)
@@ -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
index eaec64c238efdfbbc8445818093c8d9f0eb0dec3..94322ddd4e8e28ed0b8f616c9024f4cf4219c6ae 100644 (file)
 #ifndef CONTROLMATH_H
 #define CONTROLMATH_H
 
-
 #include "Dialog.h"
 #include "lfuns.h" // for kb_action
 #include "Font.h"
 
 #include <map>
 
+
 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
 
index 230c1783b76134cc9236a5c43c90d195d7cae69b..91c79159819fe769039736ef60e6baf1d477e9d5 100644 (file)
 
 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")
 {
index f4190ca9783ff95aad34fa32d2a618f42dd7b003..50d5ab5a9bafc04a6822c364e8d9c79e189839b4 100644 (file)
@@ -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 <config.h>
@@ -36,7 +36,6 @@
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "frontends/controllers/ControlMath.h"
 
 #include <algorithm>
 #include <sstream>
@@ -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;
        }