]> git.lyx.org Git - features.git/commitdiff
- remove some unused code
authorAndré Pönitz <poenitz@gmx.net>
Tue, 23 Oct 2001 09:03:07 +0000 (09:03 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 23 Oct 2001 09:03:07 +0000 (09:03 +0000)
- put some more stuff in anaon namespaces
- cosmetics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2915 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formulabase.C
src/mathed/math_atom.C
src/mathed/math_atom.h
src/mathed/math_cursor.C
src/mathed/math_cursor.h
src/mathed/math_factory.C
src/mathed/math_hash.C
src/mathed/math_inset.C
src/mathed/math_inset.h

index f683cf88c5a1f003dbfa235e6c168674a36d102c..d5605bfc3b9154b973b4fb3178a61a7b7d88c15f 100644 (file)
@@ -26,7 +26,6 @@
 #include "formulamacro.h"
 #include "commandtags.h"
 #include "math_cursor.h"
-#include "math_parser.h"
 #include "BufferView.h"
 #include "lyxtext.h"
 #include "lyxfunc.h"
@@ -503,12 +502,13 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                break;
 
        case LFUN_MATH_SIZE:
+#if 0
                if (!arg.empty()) {
                        bv->lockedInsetStoreUndo(Undo::INSERT);
-                       latexkeys const * l = in_word_set(arg);
-                       mathcursor->setSize(MathStyles(l ? l->id : static_cast<unsigned int>(-1)));
+                       mathcursor->setSize(arg);
                        updateLocal(bv, true);
                }
+#endif
                break;
 
        case LFUN_INSERT_MATRIX:
index 8c1c6ed85cd10b42d61c31b8112ea187134f8902..57acb4a0a7d9b8a113eaeb2c822604f121e6df67 100644 (file)
@@ -81,13 +81,3 @@ MathInset * MathAtom::operator->() const
 {
        return nucleus();
 }
-
-/*
-void MathAtom::userSetSize(MathStyles sz)
-{
-       if (sz >= 0) {
-               size_ = sz;      
-               flag = flag & ~LMPF_FIXED_SIZE;
-       }
-}
-*/
index 38c40469b0f575320208bcc9fea87b9c5a9bb2ee..938d1170ec939382a36f527f1cb1bc273bdd9950 100644 (file)
@@ -15,6 +15,15 @@ Exactly where the subscript and superscript are drawn depends on the
 size, and type, of the nucleus they are attached to.  
 
 Jules
+
+--
+
+Ok: Implementing it thusly is not feasible since cursor movement gets
+hackish. We use MathAtom only as a wrapper around MathInset * with value
+semantics.
+
+Andre'
+
 */
 
 class MathInset;
index c4027c2a309eaee28d9d4e0a88dddec573a58960..754a65aed3d3e3ad27ffa0fa23d9881b29c7fb17 100644 (file)
@@ -39,7 +39,6 @@
 #include "math_scriptinset.h"
 #include "math_spaceinset.h"
 #include "math_specialcharinset.h"
-#include "math_parser.h"
 
 #define FILEDEBUG 0
 
@@ -640,12 +639,6 @@ bool MathCursor::toggleLimits()
 }
 
 
-void MathCursor::setSize(MathStyles size)
-{
-       par()->userSetSize(size);
-}
-
-
 void MathCursor::macroModeClose()
 {
        string s = macroName();
@@ -1234,8 +1227,6 @@ bool MathCursor::idxRight()
 void MathCursor::interpret(string const & s)
 {
        //lyxerr << "interpret 1: '" << s << "'\n";
-       //lyxerr << "in: " << in_word_set(s) << " \n";
-
        if (s.empty())
                return;
 
index 615d3cb7b93a1e0b5751aebbcb94ad1a7c5b44a1..93b7fc029785ba2e215a6a225297a149bb4be34a 100644 (file)
@@ -140,8 +140,6 @@ public:
        ///
        void interpret(char);
        ///
-       void setSize(MathStyles);
-       ///
        bool toggleLimits();
        ///
        // Macro mode methods
index 88b8472848335ab84369bb68ddeb6428b45dc8ca..49201ac99442c92fc308347bb67b1497b29c6d7c 100644 (file)
@@ -76,7 +76,8 @@ MathAtom createMathInset(string const & s)
        if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9')
                return MathAtom(new MathMacroArgument(s[1] - '0'));
 
-       if (s.size() == 3 && s[0] == '\\' && s[1] == '#' && s[2] >= '1' && s[2] <= '9')
+       if (s.size() == 3 && s[0] == '\\' && s[1] == '#'
+                       && s[2] >= '1' && s[2] <= '9')
                return MathAtom(new MathMacroArgument(s[2] - '0'));
 
        latexkeys const * l = in_word_set(s);
@@ -86,5 +87,6 @@ MathAtom createMathInset(string const & s)
        if (MathMacroTable::has(s)) 
                return MathAtom(new MathMacro(s));
 
+       //cerr << "creating inset 2 with name: '" << s << "'\n";
        return MathAtom(new MathFuncInset(s));
 }
index 888ff8748a1cc128df5f4bf987050475162dc6f6..cf729e23320b9360401b3dcfa2bfe9317fe91abc 100644 (file)
 
 namespace {
 
-struct latexkeys_a {
+std::map<string, latexkeys> theWordList;
+
+
+struct key_type {
        ///
        char const * name;
        ///
@@ -19,7 +22,7 @@ struct latexkeys_a {
        unsigned int id;
 };
 
-latexkeys_a wordlist_array[] = 
+key_type wordlist_array[] = 
 {
        {"!",  LM_TK_SPACE, 0},
        {"#",  LM_TK_SPECIAL, '#'},
@@ -134,9 +137,6 @@ latexkeys_a wordlist_array[] =
 };
 
 
-std::map<string, latexkeys> wordlist;
-
-
 
 MathTokenEnum tokenEnum(const string & font)
 {
@@ -166,10 +166,7 @@ MathSymbolTypes symbolType(const string & type)
 }
 
 
-} // namespace anon
-
-
-void ReadSymbols(string const & filename)
+void readSymbols(string const & filename)
 {
        LyXLex lex(0, 0);
        lex.setFile(filename);
@@ -184,37 +181,39 @@ void ReadSymbols(string const & filename)
                        tmp.id = lex.getInteger();
                if (lex.next())
                        tmp.type = symbolType(lex.getString());
-               if (wordlist.find(tmp.name) != wordlist.end())
-                       lyxerr << "ReadSymbols: token " << tmp.name
+               if (theWordList.find(tmp.name) != theWordList.end())
+                       lyxerr << "readSymbols: token " << tmp.name
                               << " already exists.\n";
                else
-                       wordlist[tmp.name] = tmp;
+                       theWordList[tmp.name] = tmp;
        }
 }
 
-
 void initSymbols()
 {
        unsigned const n = sizeof(wordlist_array) / sizeof(wordlist_array[0]);
-       for (latexkeys_a * p = wordlist_array; p != wordlist_array + n; ++p) {
+       for (key_type * p = wordlist_array; p != wordlist_array + n; ++p) {
                latexkeys tmp;
                tmp.name          = p->name;
                tmp.token         = p->token;
                tmp.id            = p->id;
                tmp.type          = LMB_NONE;
                tmp.latex_font_id = 0;
-               wordlist[p->name] = tmp;
+               theWordList[p->name] = tmp;
        }
 
-       lyxerr[Debug::MATHED] << "Reading symbols file\n";
+       lyxerr[Debug::MATHED] << "reading symbols file\n";
        string const file = LibFileSearch(string(), "symbols");
        if (file.empty())
                lyxerr << "Could not find symbols file\n";
        else
-               ReadSymbols(file);
+               readSymbols(file);
 }
 
 
+} // namespace anon
+
+
 latexkeys const * in_word_set(string const & str)
 {
        static bool initialized = false;
@@ -224,6 +223,6 @@ latexkeys const * in_word_set(string const & str)
                initialized = true;
        }
 
-       std::map<string, latexkeys>::iterator it = wordlist.find(str);
-       return (it != wordlist.end()) ? &(it->second) : 0;
+       std::map<string, latexkeys>::iterator it = theWordList.find(str);
+       return (it != theWordList.end()) ? &(it->second) : 0;
 }
index 1656ac28ec5075105d9216eff223b53d1282d8b2..f8e45759743f4197364504f9b3bdcd61e79746b2 100644 (file)
@@ -189,16 +189,6 @@ void MathInset::getXY(int & x, int & y) const
 }
 
 
-/*
-void MathInset::userSetSize(MathStyles sz)
-{
-       if (sz >= 0) {
-               size_ = sz;      
-               flag = flag & ~LMPF_FIXED_SIZE;
-       }
-}
-*/
-
 void MathInset::writeNormal(std::ostream & os) const
 {
        os << "[unknown ";
index b70260e6926d7f04b4bfdc6ac348a705ff41bd50..665db40f4de0996def85df16cd087e3aa79b77e9 100644 (file)
@@ -202,9 +202,6 @@ public:
        ///
        virtual void delCol(col_type) {}
 
-       ///
-       virtual void userSetSize(MathStyles &) {}
-
        ///
        virtual void getXY(int & x, int & y) const;
        ///