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
This commit is contained in:
André Pönitz 2007-10-04 17:35:27 +00:00
parent 044c1e348c
commit 98eff22b9a
4 changed files with 27 additions and 60 deletions

View 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

View File

@ -12,13 +12,13 @@
#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

View File

@ -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")
{

View 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;
}