]> git.lyx.org Git - features.git/commitdiff
use LFUN_MESSAGE, inhritprivately from noncpopyable, remove warnings
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 17 Apr 2001 14:20:21 +0000 (14:20 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 17 Apr 2001 14:20:21 +0000 (14:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1932 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/formula.C
src/mathed/math_macro.C
src/mathed/math_macrotemplate.h
src/mathed/math_parser.C

index c65f7aa00d9141d39128e9f6e407f43a5dbab2d1..a0fd5879183c5bdebc8d54423c23f131248a2e63 100644 (file)
@@ -1,3 +1,12 @@
+2001-04-17  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * math_macrotemplate.h: inherit privately from noncopyable
+
+       * math_macro.C (Metrics): reindent, use unsigned int as loop var
+       (setArgumentIdx): change test to avoid unsigned warning
+
+       * formula.C (LocalDispatch): use LFUN_MESSAGE
+
 2001-04-16  Allan Rae  <rae@lyx.org>
 
        * formula.C (Latex, getLabelList, LocalDispatch): 
index e4fc8957f99bee28ba1b59005e2347152aadf8fd..5bd4ef0d0be2df2f23f3755997a97c284a8aa30a 100644 (file)
@@ -26,7 +26,6 @@
 #include "math_cursor.h"
 #include "math_parser.h"
 #include "lyx_main.h"
-#include "minibuffer.h"
 #include "BufferView.h"
 #include "lyxtext.h"
 #include "gettext.h"
@@ -46,6 +45,7 @@
 #include "math_spaceinset.h"
 #include "math_deliminset.h"
 #include "mathed/support.h"
+#include "lyxfunc.h"
 
 using std::ostream;
 using std::istream;
@@ -846,7 +846,7 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
        case LFUN_GREEK:
                if (!greek_kb_flag) {
                        greek_kb_flag = 1;
-                       bv->owner()->getMiniBuffer()->Set(_("Math greek mode on"));
+                       bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek mode on"));
                } else
                        greek_kb_flag = 0;
                break;
@@ -855,9 +855,9 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
        case LFUN_GREEK_TOGGLE:
                greek_kb_flag = (greek_kb_flag) ? 0 : 2;
                if (greek_kb_flag)
-                       bv->owner()->getMiniBuffer()->Set(_("Math greek keyboard on"));
+                       bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek keyboard on"));
                else
-                       bv->owner()->getMiniBuffer()->Set(_("Math greek keyboard off"));
+                       bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek keyboard off"));
                break;
 
                //  Math fonts
@@ -871,7 +871,7 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
        case LFUN_TEX:
                // varcode = LM_TC_TEX;
                mathcursor->setLastCode(LM_TC_TEX);
-               bv->owner()->getMiniBuffer()->Set(_("TeX mode"));
+               bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("TeX mode"));
                break;
 
        case LFUN_MATH_NUMBER:
@@ -883,10 +883,10 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
                                if (!label_.empty()) {
                                        label_.erase();
                                }
-                               bv->owner()->getMiniBuffer()->Set(_("No number"));
+                               bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("No number"));
                        } else {
                                ++type;
-                               bv->owner()->getMiniBuffer()->Set(_("Number"));
+                               bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Number"));
                        }
                        par->SetType(type);
                        UpdateLocal(bv);
@@ -1085,7 +1085,8 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
                // Invalid actions under math mode
        case LFUN_MATH_MODE:
                if (mathcursor->getLastCode()!= LM_TC_TEXTRM) {
-                       bv->owner()->getMiniBuffer()->Set(_("math text mode"));
+                       bv->owner()->getLyXFunc()
+                               ->Dispatch(LFUN_MESSAGE, _("math text mode"));
                        varcode = LM_TC_TEXTRM;
                } else {
                        varcode = LM_TC_VAR;
@@ -1094,13 +1095,16 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
                break;
 
        case LFUN_UNDO:
-               bv->owner()->getMiniBuffer()->Set(_("Invalid action in math mode!"));
+               bv->owner()->getLyXFunc()
+                       ->Dispatch(LFUN_MESSAGE,
+                                  _("Invalid action in math mode!"));
                break;
 
                //------- dummy actions
-       case LFUN_EXEC_COMMAND:
-               bv->owner()->getMiniBuffer()->PrepareForCommand();
-               break;
+#warning Is this needed here? Shouldnt the main dispatch handle this? (Lgb)
+               //case LFUN_EXEC_COMMAND:
+               //bv->owner()->getMiniBuffer()->PrepareForCommand();
+               //break;
 
        default:
                if ((action == -1  || action == LFUN_SELFINSERT)
@@ -1209,7 +1213,9 @@ InsetFormula::LocalDispatch(BufferView * bv, kb_action action,
                        } else if (c == '\\') {
                                if (was_macro)
                                        mathcursor->MacroModeClose();
-                               bv->owner()->getMiniBuffer()->Set(_("TeX mode"));
+                               bv->owner()->getLyXFunc()
+                                       ->Dispatch(LFUN_MESSAGE,
+                                                  _("TeX mode"));
                                mathcursor->setLastCode(LM_TC_TEX);
                        }
                        UpdateLocal(bv);
index d22a42210670d83cbe3ace58a078a90f576fac1c..eb83d1587af13808aa786611ccfc7ed4a084b478 100644 (file)
@@ -74,8 +74,8 @@ MathedInset * MathMacro::Clone()
 
 void MathMacro::Metrics()
 {
-       for (int i = 0; i < args_.size(); ++i) 
-    tmplate_->args_[i] = getArg(i);
+       for (unsigned int i = 0; i < args_.size(); ++i) 
+               tmplate_->args_[i] = getArg(i);
        tmplate_->SetStyle(size());
        tmplate_->Metrics();
        width = tmplate_->Width();
@@ -96,7 +96,7 @@ void MathMacro::draw(Painter & pain, int x, int y)
 
 bool MathMacro::setArgumentIdx(int i)
 {
-       if (i >= 0 && i < args_.size()) {
+       if (i >= 0 && 0 < (args_.size() - i)) {
                idx_ = i;
                return true;
        } else
index e000e0aa67a9c3ee8cac50e3acb0db1d77884f84..e30ef406e893a72f5c4ea2b21243392184aff401 100644 (file)
@@ -19,7 +19,7 @@ class MathMacro;
 /** This class contains the macro definition
     \author Alejandro Aguilar Sierra
  */
-class MathMacroTemplate : public MathParInset, public boost::noncopyable {
+class MathMacroTemplate : public MathParInset, boost::noncopyable {
 public:
        friend class MathMacro;
        
index f67700da4b7975d9eba9030de053d1bd2cad8a83..7f488420812511db0527699b6ee0bb3ddd776fa1 100644 (file)
@@ -138,7 +138,7 @@ lexcode_enum lexcode[256];
 #warning Replace with string
 #endif
 //char yytext[256];
-array<char, 256> yytext;
+boost::array<char, 256> yytext;
 int yylineno;
 istream * yyis;
 bool yy_mtextmode= false;