From c9c3b9b447c3f99a059730e7e4a6caf95496221a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 9 Aug 2001 09:19:18 +0000 Subject: [PATCH] move things around git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2460 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/array.C | 14 -------------- src/mathed/array.h | 8 -------- src/mathed/math_bigopinset.C | 1 + src/mathed/math_bigopinset.h | 1 + src/mathed/math_cursor.C | 3 ++- src/mathed/math_funcinset.h | 1 + src/mathed/math_funcliminset.C | 1 + src/mathed/math_gridinset.h | 1 + src/mathed/math_macro.C | 6 ++++-- src/mathed/math_macro.h | 2 +- src/mathed/math_macrotemplate.h | 1 + src/mathed/math_matrixinset.C | 1 + src/mathed/math_nestinset.C | 9 --------- src/mathed/math_nestinset.h | 2 -- src/mathed/math_parser.C | 17 +++++++++-------- src/mathed/math_scriptinset.C | 5 +++-- src/mathed/math_spaceinset.C | 1 + src/mathed/math_symbolinset.C | 3 ++- src/mathed/math_symbolinset.h | 1 + src/mathed/xarray.h | 1 + 20 files changed, 31 insertions(+), 48 deletions(-) diff --git a/src/mathed/array.C b/src/mathed/array.C index c5552aff4a..31de4bae0e 100644 --- a/src/mathed/array.C +++ b/src/mathed/array.C @@ -3,10 +3,8 @@ #endif #include "math_inset.h" -#include "math_charinset.h" #include "debug.h" #include "array.h" -#include "math_scriptinset.h" #include "mathed/support.h" using std::ostream; @@ -84,12 +82,6 @@ void MathArray::insert(int pos, MathInset * p) } -void MathArray::insert(int pos, unsigned char b, MathTextCodes t) -{ - bf_.insert(begin() + pos, new MathCharInset(b, t)); -} - - void MathArray::insert(int pos, MathArray const & array) { bf_.insert(begin() + pos, array.begin(), array.end()); @@ -103,12 +95,6 @@ void MathArray::push_back(MathInset * p) } -void MathArray::push_back(unsigned char b, MathTextCodes c) -{ - insert(size(), b, c); -} - - void MathArray::push_back(MathArray const & array) { insert(size(), array); diff --git a/src/mathed/array.h b/src/mathed/array.h index f37e0c9843..f5c6d84923 100644 --- a/src/mathed/array.h +++ b/src/mathed/array.h @@ -19,12 +19,8 @@ #include #include -#include "mathed/support.h" -#include "math_defs.h" - class MathInset; class MathMacro; -class Painter; class LaTeXFeatures; #ifdef __GNUG__ @@ -72,8 +68,6 @@ public: /// void insert(int pos, MathInset * inset); /// - void insert(int pos, unsigned char, MathTextCodes); - /// void insert(int pos, MathArray const &); /// @@ -89,8 +83,6 @@ public: /// void push_back(MathInset * inset); /// - void push_back(unsigned char, MathTextCodes); - /// void push_back(MathArray const &); /// void pop_back(); diff --git a/src/mathed/math_bigopinset.C b/src/mathed/math_bigopinset.C index 232e0d4564..5426095297 100644 --- a/src/mathed/math_bigopinset.C +++ b/src/mathed/math_bigopinset.C @@ -1,5 +1,6 @@ #include "math_bigopinset.h" #include "mathed/math_parser.h" +#include "mathed/support.h" #include "support/LOstream.h" diff --git a/src/mathed/math_bigopinset.h b/src/mathed/math_bigopinset.h index 660ccfe08e..896c1969f6 100644 --- a/src/mathed/math_bigopinset.h +++ b/src/mathed/math_bigopinset.h @@ -6,6 +6,7 @@ // larger in displayed formulae and take limits #include "math_diminset.h" +#include "LString.h" struct latexkeys; diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 3ec44ee22e..6f3562a52c 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -31,6 +31,7 @@ #include "math_cursor.h" #include "math_arrayinset.h" #include "math_bigopinset.h" +#include "math_charinset.h" #include "math_symbolinset.h" #include "math_decorationinset.h" #include "math_deliminset.h" @@ -417,7 +418,7 @@ void MathCursor::insert(char c, MathTextCodes t) } } - array().insert(pos(), c, t); + array().insert(pos(), new MathCharInset(c, t)); posRight(); } diff --git a/src/mathed/math_funcinset.h b/src/mathed/math_funcinset.h index ad6a9791ff..3a773df15f 100644 --- a/src/mathed/math_funcinset.h +++ b/src/mathed/math_funcinset.h @@ -4,6 +4,7 @@ #include "math_diminset.h" #include "math_defs.h" +#include "LString.h" #ifdef __GNUG__ #pragma interface diff --git a/src/mathed/math_funcliminset.C b/src/mathed/math_funcliminset.C index 4ceeaaddbe..b527af5fa2 100644 --- a/src/mathed/math_funcliminset.C +++ b/src/mathed/math_funcliminset.C @@ -1,5 +1,6 @@ #include "math_funcliminset.h" #include "mathed/math_parser.h" +#include "mathed/support.h" #include "support/LOstream.h" diff --git a/src/mathed/math_gridinset.h b/src/mathed/math_gridinset.h index 885ae2b1df..101d506fc3 100644 --- a/src/mathed/math_gridinset.h +++ b/src/mathed/math_gridinset.h @@ -3,6 +3,7 @@ #define MATH_GRID_H #include "math_nestinset.h" +#include "LString.h" #ifdef __GNUG__ #pragma interface diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 12738d6d48..933237605a 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -48,11 +48,13 @@ MathInset * MathMacro::clone() const return new MathMacro(*this); } -string const & MathMacro::name() const + +const char * MathMacro::name() const { - return tmplate_->name(); + return tmplate_->name().c_str(); } + void MathMacro::metrics(MathStyles st) const { if (mathcursor && mathcursor->isInside(this)) { diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index d54f064acb..a3d124ebd5 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -69,7 +69,7 @@ private: /// void operator=(MathMacro const &); /// - string const & name() const; + char const * name() const; /// MathMacroTemplate const * const tmplate_; diff --git a/src/mathed/math_macrotemplate.h b/src/mathed/math_macrotemplate.h index a8c028cac5..628a9bee68 100644 --- a/src/mathed/math_macrotemplate.h +++ b/src/mathed/math_macrotemplate.h @@ -3,6 +3,7 @@ #define MATH_MACROTEMPLATE_H #include "math_nestinset.h" +#include "LString.h" #ifdef __GNUG__ #pragma interface diff --git a/src/mathed/math_matrixinset.C b/src/mathed/math_matrixinset.C index 8508b4a572..c521e819b0 100644 --- a/src/mathed/math_matrixinset.C +++ b/src/mathed/math_matrixinset.C @@ -5,6 +5,7 @@ #include #include "math_matrixinset.h" +#include "support.h" #include "debug.h" #include "support/LOstream.h" #include "Painter.h" diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 32ab637300..ebe624c044 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -148,15 +148,6 @@ void MathNestInset::dump() const } -void MathNestInset::push_back(unsigned char ch, MathTextCodes fcode) -{ - if (nargs()) - cells_.back().data_.push_back(ch, fcode); - else - lyxerr << "can't push without a cell\n"; -} - - void MathNestInset::push_back(MathInset * p) { if (nargs()) diff --git a/src/mathed/math_nestinset.h b/src/mathed/math_nestinset.h index 97569f4526..068fbad165 100644 --- a/src/mathed/math_nestinset.h +++ b/src/mathed/math_nestinset.h @@ -62,8 +62,6 @@ public: /// void push_back(MathInset *); /// - void push_back(unsigned char ch, MathTextCodes fcode); - /// void dump() const; /// diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index df7ee5ceb7..b5338a4be9 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -30,6 +30,7 @@ #include "math_inset.h" #include "math_arrayinset.h" #include "math_bigopinset.h" +#include "math_charinset.h" #include "math_dotsinset.h" #include "math_decorationinset.h" #include "math_deliminset.h" @@ -553,7 +554,7 @@ void mathed_parse_into(MathArray & array, unsigned flags) case LM_TK_ALPHA: if (!isspace(yylval.i) || yyvarcode == LM_TC_TEXTRM) - array.push_back(yylval.i, yyvarcode); + array.push_back(new MathCharInset(yylval.i, yyvarcode)); break; case LM_TK_ARGUMENT: { @@ -564,11 +565,11 @@ void mathed_parse_into(MathArray & array, unsigned flags) } case LM_TK_SPECIAL: - array.push_back(yylval.i, LM_TC_SPECIAL); + array.push_back(new MathCharInset(yylval.i, LM_TC_SPECIAL)); break; case LM_TK_STR: - array.push_back(yylval.i, LM_TC_CONST); + array.push_back(new MathCharInset(yylval.i, LM_TC_CONST)); break; case LM_TK_OPEN: @@ -576,7 +577,7 @@ void mathed_parse_into(MathArray & array, unsigned flags) if (flags & FLAG_BRACE) flags &= ~FLAG_BRACE; else - array.push_back('{', LM_TC_TEX); + array.push_back(new MathCharInset('{', LM_TC_TEX)); break; case LM_TK_CLOSE: @@ -594,18 +595,18 @@ void mathed_parse_into(MathArray & array, unsigned flags) if (brace == 0 && (flags & FLAG_BRACE_LAST)) flags |= FLAG_LEAVE; else - array.push_back('}', LM_TC_TEX); + array.push_back(new MathCharInset('}', LM_TC_TEX)); break; case '[': - array.push_back('[', LM_TC_CONST); + array.push_back(new MathCharInset('[', LM_TC_CONST)); break; case ']': if (flags & FLAG_BRACK_END) flags |= FLAG_LEAVE; else - array.push_back(']', LM_TC_CONST); + array.push_back(new MathCharInset(']', LM_TC_CONST)); break; case '^': @@ -662,7 +663,7 @@ void mathed_parse_into(MathArray & array, unsigned flags) break; case LM_TK_BOP: - array.push_back(yylval.i, LM_TC_BOP); + array.push_back(new MathCharInset(yylval.i, LM_TC_BOP)); break; case LM_TK_SPACE: diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index a22a88296a..158c2b91c4 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -4,6 +4,7 @@ #include "math_scriptinset.h" #include "support/LOstream.h" +#include "support.h" MathScriptInset::MathScriptInset() @@ -239,8 +240,8 @@ void MathScriptInset::metrics(MathStyles st) const dx0_ = (width_ - xcell(0).width()) / 2; dx1_ = (width_ - xcell(1).width()) / 2; } else { - int asc; - int des; + int asc = 0; + int des = 0; int wid = 0; mathed_char_height(LM_TC_VAR, st, 'I', asc, des); if (symbol_) { diff --git a/src/mathed/math_spaceinset.C b/src/mathed/math_spaceinset.C index aacab30ca4..764a324bfc 100644 --- a/src/mathed/math_spaceinset.C +++ b/src/mathed/math_spaceinset.C @@ -3,6 +3,7 @@ #endif #include "math_spaceinset.h" +#include "support.h" #include "LColor.h" #include "Painter.h" #include "support/LOstream.h" diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index ea1efff9b0..d93776f05a 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -1,5 +1,6 @@ #include "math_symbolinset.h" -#include "mathed/math_parser.h" +#include "math_parser.h" +#include "support.h" #include "support/LOstream.h" diff --git a/src/mathed/math_symbolinset.h b/src/mathed/math_symbolinset.h index ac54572dde..679d2efb82 100644 --- a/src/mathed/math_symbolinset.h +++ b/src/mathed/math_symbolinset.h @@ -3,6 +3,7 @@ #define MATH_SYMBOLINSET_H #include "math_diminset.h" +#include "LString.h" struct latexkeys; diff --git a/src/mathed/xarray.h b/src/mathed/xarray.h index 06cbececc4..0dc4ddcee9 100644 --- a/src/mathed/xarray.h +++ b/src/mathed/xarray.h @@ -5,6 +5,7 @@ #include #include "array.h" +#include "math_defs.h" #ifdef __GNUG__ #pragma interface