]> git.lyx.org Git - lyx.git/commitdiff
more latex conversion cases fixed, patch from Andre, more more funcs to lowercase...
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 2 Aug 2001 18:46:53 +0000 (18:46 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 2 Aug 2001 18:46:53 +0000 (18:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2406 a592a061-630c-0410-9148-cb99ea01b6c8

19 files changed:
src/BufferView_pimpl.C
src/ChangeLog
src/LaTeX.C
src/LyXView.C
src/Thesaurus.C
src/Thesaurus.h
src/buffer.C
src/bufferview_funcs.C
src/bufferview_funcs.h
src/frontends/controllers/ControlCharacter.C
src/frontends/controllers/ControlThesaurus.C
src/gettext.C
src/insets/insettext.C
src/lyxfunc.C
src/lyxrc.C
src/mathed/formulabase.C
src/mathed/math_parser.C
src/tabular-old.C
src/text.C

index 4cef48be677264074bc672c45050216313caa1e5..2a4cc26f0ee04e7d4320b3a5f1bba5ba08369cf5 100644 (file)
@@ -67,7 +67,6 @@
 #include "mathed/formulabase.h"
 
 extern LyXTextClass::size_type current_layout;
-extern int greek_kb_flag;
 
 using std::vector;
 using std::find_if;
@@ -85,7 +84,6 @@ bool selection_possible = false;
 extern BufferList bufferlist;
 extern char ascii_type;
 
-extern bool math_insert_greek(BufferView *, char);
 extern void sigchldchecker(pid_t pid, int * status);
 extern int bibitemMaxWidth(BufferView *, LyXFont const &);
 
@@ -1668,58 +1666,58 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        break;
 
        case LFUN_LANGUAGE:
-               Lang(bv_, argument);
+               lang(bv_, argument);
                setState();
                owner_->showState();
                break;
 
        case LFUN_EMPH:
-               Emph(bv_);
+               emph(bv_);
                owner_->showState();
                break;
 
        case LFUN_BOLD:
-               Bold(bv_);
+               bold(bv_);
                owner_->showState();
                break;
                
        case LFUN_NOUN:
-               Noun(bv_);
+               noun(bv_);
                owner_->showState();
                break;
                
        case LFUN_CODE:
-               Code(bv_);
+               code(bv_);
                owner_->showState();
                break;
                
        case LFUN_SANS:
-               Sans(bv_);
+               sans(bv_);
                owner_->showState();
                break;
                
        case LFUN_ROMAN:
-               Roman(bv_);
+               roman(bv_);
                owner_->showState();
                break;
                
        case LFUN_DEFAULT:
-               StyleReset(bv_);
+               styleReset(bv_);
                owner_->showState();
                break;
                
        case LFUN_UNDERLINE:
-               Underline(bv_);
+               underline(bv_);
                owner_->showState();
                break;
                
        case LFUN_FONT_SIZE:
-               FontSize(bv_, argument);
+               fontSize(bv_, argument);
                owner_->showState();
                break;
                
        case LFUN_FONT_STATE:
-               owner_->getLyXFunc()->setMessage(CurrentState(bv_));
+               owner_->getLyXFunc()->setMessage(currentState(bv_));
                break;
                
        case LFUN_UPCASE_WORD:
@@ -3002,10 +3000,11 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                InsetCommandParams p("index");
                if (argument.empty()) {
                        string const idxstring(bv_->getLyXText()->getStringToIndex(bv_));
-                       if (!idxstring.empty()) 
+                       if (!idxstring.empty()) {
                                p.setContents(idxstring);
-                       else
+                       } else {
                                break;
+                       }
                } else {
                        p.setContents(argument);
                }
@@ -3137,11 +3136,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                string::const_iterator cit = argument.begin();
                string::const_iterator end = argument.end();
                for (; cit != end; ++cit) {
-                       if (greek_kb_flag) {
-                               if (!math_insert_greek(bv_, *cit))
-                                       owner_->getIntl()->getTrans().TranslateAndInsert(*cit, lt);
-                       } else
-                               owner_->getIntl()->getTrans().TranslateAndInsert(*cit, lt);
+                       owner_->getIntl()->getTrans().TranslateAndInsert(*cit, lt);
                }
                
                bv_->update(lt,
index 2149f962e99b0e2f5c6ca8ed7cc79275a91ed251..56421640facb37f7bbc9d7f49dc853a9f65e9279 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-02  André Pönitz <poenitz@gmx.net>
+
+       * lyxfunc.C:
+       BufferView_pimpl.C: remove broken special code for math-greek
+
 2001-08-02  Juergen Vigna  <jug@sad.it>
 
        * BufferView_pimpl.C (update): redone this function so that we
index 1d236c1ba0849f046b45ce9f2c0d9eeb13968f91..c4ce8c3398c1fe6677ee14434960fb5466fc3975 100644 (file)
@@ -181,8 +181,6 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
                lfun->dispatch(LFUN_MESSAGE, str.str().c_str());
        }
        
-       
-       //WriteStatus(lfun, string(_("LaTeX run number ")) + tostr(count));
        this->operator()();
        scanres = scanLogFile(terr);
        if (scanres & ERROR_RERUN) {
@@ -319,7 +317,6 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
                        lfun->dispatch(LFUN_MESSAGE, str.str().c_str());
                }
                
-//             WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
                this->operator()();
                scanres = scanLogFile(terr);
                if (scanres & ERRORS) {
index a0313ab7c6318f98eb3b6e6ed9302269dc62cb8b..be476aa52228d02f8ec672f95f102e0ff435f26c 100644 (file)
@@ -241,7 +241,7 @@ void LyXView::updateWindowTitle()
 
 void LyXView::showState()
 {
-       message(CurrentState(view()));
+       message(currentState(view()));
        getToolbar()->update();
        menubar->update();
 }
index 8e30bf9da7d6b267b4426f820a6d641e0058bc8d..d45b3d4fbbc9def050c65a305f381fce8c0aa491 100644 (file)
@@ -72,7 +72,8 @@ Thesaurus::~Thesaurus()
 }
 
  
-std::vector<Thesaurus::ThesaurusEntry> Thesaurus::lookup(string const & text)
+std::vector<Thesaurus::ThesaurusEntry>
+Thesaurus::lookup(string const & /*text*/)
 {
        return std::vector<ThesaurusEntry>();
 }
index fc04d72a0cbdbed65ebacdc94cb28dc9f70b8ce7..5ade7daf8d70337045483fd0bac895e6f198aa3d 100644 (file)
@@ -1,3 +1,4 @@
+// -*- C++ -*-
 /**
  * \file Thesaurus.h
  * Copyright 2001 the LyX Team
index 9246a6bc808642c9e2088e5fefd1db9a78eaacac..1a85f114b2e2ff93c914edc7733e832ae5abc01b 100644 (file)
@@ -547,6 +547,11 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
 #endif
 
        } else if (token == "\\begin_float") {
+               insertErtContents(par, pos, font);
+               //insertErtContents(par, pos, font, false);
+               //ert_stack.push(ert_comp);
+               //ert_comp = ErtComp();
+               
                // This is the compability reader. It can be removed in
                // LyX version 1.3.0. (Lgb)
                lex.next();
@@ -628,6 +633,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                inset->read(this, nylex);
                par->insertInset(pos, inset, font);
                ++pos;
+               insertErtContents(par, pos, font);
        } else if (token == "\\begin_deeper") {
                ++depth;
        } else if (token == "\\end_deeper") {
@@ -1051,6 +1057,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
 #ifdef NO_LATEX
                ert_comp = ert_stack.top();
                ert_stack.pop();
+               insertErtContents(par, pos, font);
 #endif
        } else if (token == "\\SpecialChar") {
                LyXLayout const & layout =
index 4c81cdd459270db5bccae6b383502543412a6cdb..f32ba3254ab17d0588e5f88e3730af6f6a89b8e4 100644 (file)
 #include "gettext.h"
 #include "ParagraphParameters.h"
 
-void Emph(BufferView * bv)
+
+void emph(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setEmph(LyXFont::TOGGLE);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void Bold(BufferView * bv)
+void bold(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setSeries(LyXFont::BOLD_SERIES);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void Noun(BufferView * bv)
+void noun(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setNoun(LyXFont::TOGGLE);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void Number(BufferView * bv)
+void number(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setNumber(LyXFont::TOGGLE);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
-void Lang(BufferView * bv, string const & l)
+void lang(BufferView * bv, string const & l)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        Language const * lang = languages.getLanguage(l);
        if (lang) {
                font.setLanguage(lang);
-               ToggleAndShow(bv, font);
+               toggleAndShow(bv, font);
        } else
                WriteAlert(_("Error! unknown language"),l);
 }
 
 
 #ifndef NO_LATEX
-void Tex(BufferView * bv)
+void tex(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setLatex (LyXFont::TOGGLE);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 #endif
 
@@ -103,55 +104,55 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
 }
 
 
-void Code(BufferView * bv)
+void code(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setFamily(LyXFont::TYPEWRITER_FAMILY); // no good
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void Sans(BufferView * bv)
+void sans(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setFamily(LyXFont::SANS_FAMILY);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void Roman(BufferView * bv)
+void roman(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setFamily(LyXFont::ROMAN_FAMILY);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void StyleReset(BufferView * bv)
+void styleReset(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_INHERIT);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void Underline(BufferView * bv)
+void underline(BufferView * bv)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setUnderbar(LyXFont::TOGGLE);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
-void FontSize(BufferView * bv, string const & size)
+void fontSize(BufferView * bv, string const & size)
 {
        LyXFont font(LyXFont::ALL_IGNORE);
        font.setLyXSize(size);
-       ToggleAndShow(bv, font);
+       toggleAndShow(bv, font);
 }
 
 
 // Returns the current font and depth as a message. 
-string const CurrentState(BufferView * bv)
+string const currentState(BufferView * bv)
 {
        ostringstream state;
 
@@ -211,7 +212,7 @@ string const CurrentState(BufferView * bv)
 /* -------> Does the actual toggle job of the XxxCB() calls above.
  * Also shows the current font state.
  */
-void ToggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
+void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
 {
        if (bv->available()) { 
                if (bv->theLockingInset()) {
index 51b0823be3fa72df9a1f73f7c8a17f1d2467fa6e..01895550fbd8333a236443543f1f7ca3c4b5f747 100644 (file)
@@ -23,37 +23,36 @@ class LyXFont;
 class LyXText;
 
 ///
-extern void Emph(BufferView *);
+extern void emph(BufferView *);
 ///
-extern void Bold(BufferView *);
+extern void bold(BufferView *);
 ///
-extern void Noun(BufferView *);
+extern void noun(BufferView *);
 ///
-extern void Figure();
+extern void table();
 ///
-extern void Table();
+extern void lang(BufferView *, string const &);
 ///
-extern void Lang(BufferView *, string const &);
+extern void number(BufferView *);
 ///
-extern void Number(BufferView *);
-///
-extern void Tex(BufferView *);
+extern void tex(BufferView *);
 ///
 extern void changeDepth(BufferView *, LyXText *, int);
 ///
-extern void Code(BufferView *);
+extern void code(BufferView *);
 ///
-extern void Sans(BufferView *);
+extern void sans(BufferView *);
 ///
-extern void Roman(BufferView *);
+extern void roman(BufferView *);
 ///
-extern void StyleReset(BufferView *);
+extern void styleReset(BufferView *);
 ///
-extern void Underline(BufferView *);
+extern void underline(BufferView *);
 ///
-extern void FontSize(BufferView *, string const &);
+extern void fontSize(BufferView *, string const &);
 /// Returns the current font and depth as a message. 
-extern string const CurrentState(BufferView *);
+extern string const currentState(BufferView *);
 ///
-extern void ToggleAndShow(BufferView *, LyXFont const &, bool toggleall=true);
+extern void toggleAndShow(BufferView *, LyXFont const &,
+                         bool toggleall = true);
 #endif
index 5b459abbceb4501036a5c5e1aa31764e16867ee2..4c6a1ff91ac9722ded2abfc694518854e9c3ca70 100644 (file)
@@ -69,7 +69,7 @@ void ControlCharacter::apply()
        if (lv_.view()->available())
                view().apply();
 
-       ToggleAndShow(lv_.view(), *(font_.get()), toggleall_);
+       toggleAndShow(lv_.view(), *(font_.get()), toggleall_);
        lv_.view()->setState();
        lv_.buffer()->markDirty();
        setMinibuffer(&lv_, _("Character set"));
index 03f82ed0e1b4d5087106d0f319086dd36036ebad..c90582956199a86552d2c08bb3c925286a36995d 100644 (file)
@@ -59,7 +59,8 @@ void ControlThesaurus::replace(string const & newstr)
 }
 
 
-std::vector<string> ControlThesaurus::getEntries(string const & str, Thesaurus::POS pos)
+std::vector<string>
+ControlThesaurus::getEntries(string const & str, Thesaurus::POS pos)
 {
        if (str != laststr_)
                entries_ = thesaurus.lookup(str);
index f9163fcb34416c2d1b30b4cbbd377a18f53f0ad8..77b1a672755bca096a9f6e2d725c9d8474288418 100644 (file)
@@ -42,12 +42,12 @@ string const _(string const & str)
                char * tmp = new char[s + 1];
                str.copy(tmp, s);
                tmp[s] = '\0';
-               string ret(gettext(tmp));
+               string const ret(gettext(tmp));
                delete [] tmp;
                return ret;
-       }
-       else
+       } else {
                return string();
+       }
 }
 
 void locale_init()
index bbe84be37ab8196283afad708f31cfdf369e4d7b..483a7a8731aa4b3ec4fb82c0e2752efa0705df32 100644 (file)
@@ -1008,15 +1008,7 @@ InsetText::localDispatch(BufferView * bv,
                        }
                        lt->clearSelection();
                        for (string::size_type i = 0; i < arg.length(); ++i) {
-                               if (greek_kb_flag) {
-                                       if (!math_insert_greek(bv, arg[i])) {
-                                               bv->owner()->getIntl()->getTrans().TranslateAndInsert(arg[i], lt);
-                                       } else if (!the_locking_inset) {
-                                               (void)moveRight(bv, false);
-                                       }
-                               } else {
-                                       bv->owner()->getIntl()->getTrans().TranslateAndInsert(arg[i], lt);
-                               }
+                               bv->owner()->getIntl()->getTrans().TranslateAndInsert(arg[i], lt);
                        }
                }
                lt->selection.cursor = lt->cursor;
index 6411a80b6e0547affb39de4ab71554f22351d5d6..d83a353312249dcbf3df48422bdf9c1f348aaef2 100644 (file)
@@ -94,6 +94,7 @@
 #include "TextCache.h"
 #include "lyxfind.h"
 #include "undo_funcs.h"
+#include "figureForm.h"
 
 using std::pair;
 using std::make_pair; 
@@ -1454,30 +1455,6 @@ string const LyXFunc::dispatch(int ac,
        // --- insert characters ----------------------------------------
 
        // ---  Mathed stuff. If we are here, there is no locked inset yet.
-       
-       // Greek mode     
-       case LFUN_GREEK:
-       {
-               if (!greek_kb_flag) {
-                       greek_kb_flag = 1;
-                       setMessage(N_("Math greek mode on"));
-               } else
-                       greek_kb_flag = 0;
-       }  
-       break;
-      
-       // Greek keyboard      
-       case LFUN_GREEK_TOGGLE:
-       {
-               greek_kb_flag = greek_kb_flag ? 0 : 2;
-               if (greek_kb_flag) {
-                       setMessage(N_("Math greek keyboard on"));
-               } else {
-                       setMessage(N_("Math greek keyboard off"));
-               }
-       }
-       break;
-       
        case LFUN_MATH_EXTERN:
        case LFUN_MATH_NUMBER:
        case LFUN_MATH_NONUMBER:
index 0c5978bcb4b90b92a7f73e85f9000dc2e5189dd7..6770a634365f09f370a918369f1ed63049bd5bcf 100644 (file)
@@ -275,6 +275,7 @@ void LyXRC::readBindFileIfNeeded()
                ReadBindFile(bind_file);
 }
 
+
 int LyXRC::read(string const & filename)
 {      
        LyXLex lexrc(lyxrcTags, lyxrcCount);
@@ -306,8 +307,9 @@ int LyXRC::read(string const & filename)
                switch (static_cast<LyXRCTags>(le)) {
                case RC_INPUT: // Include file
                        if (lexrc.next()) {
-                               string tmp = LibFileSearch(string(),
-                                                          lexrc.GetString()); 
+                               string const tmp =
+                                       LibFileSearch(string(),
+                                                     lexrc.GetString()); 
                                if (read(tmp)) {
                                        lexrc.printError("Error reading "
                                                         "included file: "+tmp);
@@ -316,7 +318,7 @@ int LyXRC::read(string const & filename)
                        break;
                case RC_BINDFILE:                     // RVDK_PATCH_5
                        if (lexrc.next()) {
-                               string tmp(lexrc.GetString());
+                               string const tmp(lexrc.GetString());
                                if (hasBindFile)
                                        // We are already in the
                                        // "actually read bind file"
@@ -353,7 +355,7 @@ int LyXRC::read(string const & filename)
                        
                case RC_KBMAP_PRIMARY:
                        if (lexrc.next()) {
-                               string kmap(lexrc.GetString());
+                               string const kmap(lexrc.GetString());
                                if (kmap.empty()) {
                                        // nothing
                                } else if (!LibFileSearch("kbd", kmap, 
@@ -366,7 +368,7 @@ int LyXRC::read(string const & filename)
                        
                case RC_KBMAP_SECONDARY:
                        if (lexrc.next()) {
-                               string kmap(lexrc.GetString());
+                               string const kmap(lexrc.GetString());
                                if (kmap.empty()) {
                                        // nothing
                                } else if (!LibFileSearch("kbd", kmap, 
@@ -484,7 +486,8 @@ int LyXRC::read(string const & filename)
 
                case RC_DEFAULT_PAPERSIZE:
                         if (lexrc.next()) {
-                               string size = lowercase(lexrc.GetString());
+                               string const size =
+                                       lowercase(lexrc.GetString());
                                if (size == "usletter")
                                        default_papersize =
                                                BufferParams::PAPER_USLETTER;
index 4a4809a98cc6cac5978722e61b944acf5f72ce55..972a0296bf7d25dbca10501ee7dcbb23ee0214e0 100644 (file)
@@ -811,7 +811,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                                
                                mathcursor->insert(c, char_code);
                                
-                               if (greek_kb_flag && char_code == LM_TC_RM )
+                               if (greek_kb_flag && char_code == LM_TC_RM)
                                        mathcursor->setLastCode(LM_TC_VAR);
                                
                                varcode = LM_TC_MIN;
@@ -910,46 +910,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
 }
 
 
-
-/* FIXME: math-greek-toggle seems to work OK, but math-greek doesn't turn
- * on greek mode */
-bool math_insert_greek(BufferView * bv, char c)
-{
-       if (!bv->available())
-               return false;
-
-       if (!isalpha(c))
-               return false;
-
-       string tmp;
-       tmp = c;
-       if (!bv->theLockingInset() || bv->theLockingInset()->isTextInset()) {
-               int greek_kb_flag_save = greek_kb_flag;
-               InsetFormula * new_inset = new InsetFormula();
-               bv->beforeChange(bv->text);
-               if (!bv->insertInset(new_inset)) {
-                       delete new_inset;
-                       return false;
-               }
-               //Update(1);//BUG
-               new_inset->edit(bv, 0, 0, 0);
-               new_inset->localDispatch(bv, LFUN_SELFINSERT, tmp);
-               if (greek_kb_flag_save < 2) {
-                       bv->unlockInset(new_inset); // bv->theLockingInset());
-                       bv->text->cursorRight(bv, true);
-               }
-       } else
-               if (bv->theLockingInset()->lyxCode() == Inset::MATH_CODE ||
-                               bv->theLockingInset()->lyxCode() == Inset::MATHMACRO_CODE)
-                       static_cast<InsetFormula*>(bv->theLockingInset())->localDispatch(bv, LFUN_SELFINSERT, tmp);
-               else
-                       lyxerr << "Math error: attempt to write on a wrong "
-                               "class of inset." << endl;
-       return true;
-}
-
-
-
 Inset::Code InsetFormulaBase::lyxCode() const
 {
        return Inset::MATH_CODE;
index f3b95d443cef5aa09a74096972bfd1c16cc6acc2..f9f98675d17d6cce4132f645a8aadb4b51185511 100644 (file)
@@ -87,6 +87,10 @@ unsigned char getuchar(std::istream * is)
 {
        char c;
        is->get(c);
+       if (!is->good()) {
+               lyxerr << "The input stream is not well..." << endl;
+       }
+       
        return static_cast<unsigned char>(c);
 }
 
@@ -349,7 +353,6 @@ int yylex()
 }
 
 
-
 MathScriptInset * prevScriptInset(MathArray const & array)
 {
        MathInset * p = array.back_inset();
@@ -380,21 +383,21 @@ MathInset * lastScriptInset(MathArray & array, bool up, bool down, int limits)
 }
 
 
-
 static bool   curr_num;
 static string curr_label;
 
-void mathed_parse_lines(MathInset * inset, int col, bool numbered, bool outmost)
+void mathed_parse_lines(MathInset * inset, int col,
+                       bool numbered, bool outmost)
 {
        // save global variables
-       bool   saved_num   = curr_num;
-       string saved_label = curr_label;
+       bool   const saved_num   = curr_num;
+       string const saved_label = curr_label;
 
        MathGridInset * p = static_cast<MathGridInset *>(inset);
        for (int row = 0; true; ++row) {
                // reset global variables
                curr_num   = numbered;
-               curr_label = string();
+               curr_label.erase();
 
                // reading a row
                int idx = p->nargs() - p->ncols();
@@ -429,8 +432,8 @@ MathInset * mathed_parse()
 
        switch (t) {
                case LM_TK_NEWCOMMAND: {
-                       string name = lexArg('{').substr(1);
-                       string arg  = lexArg('[');
+                       string const name = lexArg('{').substr(1);
+                       string const arg  = lexArg('[');
                        int    narg = arg.empty() ? 0 : atoi(arg.c_str()); 
                        p = new MathMacroTemplate(name, narg);
                        mathed_parse_into(p->cell(0), FLAG_BRACE | FLAG_BRACE_LAST);
@@ -453,7 +456,7 @@ MathInset * mathed_parse()
 
                                case LM_OT_SIMPLE: {
                                        curr_num   = latex_mathenv[i].numbered;
-                                       curr_label = string();
+                                       curr_label.erase();
                                        mathed_parse_into(m->cell(0), 0);
                                        m->numbered(0, curr_num);
                                        m->label(0, curr_label);
@@ -462,7 +465,7 @@ MathInset * mathed_parse()
 
                                case LM_OT_EQUATION: {
                                        curr_num   = latex_mathenv[i].numbered;
-                                       curr_label = string();
+                                       curr_label.erase();
                                        mathed_parse_into(m->cell(0), FLAG_END);
                                        m->numbered(0, curr_num);
                                        m->label(0, curr_label);
@@ -580,7 +583,7 @@ void mathed_parse_into(MathArray & array, unsigned flags)
                        break;
 
                case LM_TK_CLOSE:
-                       --brace;         
+                       --brace;
                        if (brace < 0) {
                                mathPrintError("Unmatching braces");
                                panic = true;
@@ -779,8 +782,8 @@ void mathed_parse_into(MathArray & array, unsigned flags)
                        MathInsetTypes typ = latex_mathenv[i].typ;
 
                        if (typ == LM_OT_MATRIX) {
-                               string valign = lexArg('[') + 'c';
-                               string halign = lexArg('{');
+                               string const valign = lexArg('[') + 'c';
+                               string const halign = lexArg('{');
                                //lyxerr << "valign: '" << valign << "'\n";
                                //lyxerr << "halign: '" << halign << "'\n";
                                MathArrayInset * m = new MathArrayInset(halign.size(), 1);
@@ -822,9 +825,9 @@ void mathed_parse_into(MathArray & array, unsigned flags)
                        do {
                                t = yylex();
                        } while (yyis->good() && t != LM_TK_END && t);
-               } else
+               } else {
                        t = yylex();
-
+               }
        }
        --plevel;
 }
index ec9c0fe9bc2495f9b8d457097ed45efbec610500..6b943119dfac2a30518a302006b407e45740e2af 100644 (file)
@@ -26,7 +26,7 @@ using std::strlen;
 
 namespace {
 
-bool getTokenValue(string const & str, const char * token, string & ret)
+bool getTokenValue(string const & str, char const * token, string & ret)
 {
     size_t token_length = strlen(token);
     string::size_type pos = str.find(token);
@@ -48,7 +48,7 @@ bool getTokenValue(string const & str, const char * token, string & ret)
 }
 
 
-bool getTokenValue(string const & str, const char * token, int & num)
+bool getTokenValue(string const & str, char const * token, int & num)
 {
     string::size_type pos = str.find(token);
     char ch = str[pos + strlen(token)];
@@ -72,7 +72,7 @@ bool getTokenValue(string const & str, const char * token, int & num)
 }
 
 
-bool getTokenValue(string const & str, const char * token, LyXAlignment & num)
+bool getTokenValue(string const & str, char const * token, LyXAlignment & num)
 {
     int tmp;
     bool const ret = getTokenValue(str, token, tmp);
@@ -81,7 +81,7 @@ bool getTokenValue(string const & str, const char * token, LyXAlignment & num)
 }
 
 
-bool getTokenValue(string const & str, const char * token,
+bool getTokenValue(string const & str, char const * token,
                   LyXTabular::VAlignment & num)
 {
     int tmp;
@@ -91,7 +91,7 @@ bool getTokenValue(string const & str, const char * token,
 }
 
 
-bool getTokenValue(string const & str, const char * token,
+bool getTokenValue(string const & str, char const * token,
                   LyXTabular::BoxType & num)
 {
     int tmp;
@@ -101,7 +101,7 @@ bool getTokenValue(string const & str, const char * token,
 }
 
 
-bool getTokenValue(string const & str, const char * token, bool & flag)
+bool getTokenValue(string const & str, char const * token, bool & flag)
 {
     string::size_type pos = str.find(token);
     char ch = str[pos + strlen(token)];
index b71245a4858aff55a92899b1c59e9b669040e1e8..6d14ad0b2b098518efa1bcd3786fb34070bf06cf 100644 (file)
@@ -1747,10 +1747,10 @@ void LyXText::insertChar(BufferView * bview, char c)
                                      cursor.par(),
                                      cursor.pos()-1).number() == LyXFont::ON)
                            )
-                               Number(bview); // Set current_font.number to OFF
+                               number(bview); // Set current_font.number to OFF
                } else if (isdigit(c) &&
                           real_current_font.isVisibleRightToLeft()) {
-                       Number(bview); // Set current_font.number to ON
+                       number(bview); // Set current_font.number to ON
 
                        if (cursor.pos() > 0) {
                                char const c = cursor.par()->getChar(cursor.pos() - 1);