use LFUN_MESSAGE, inhritprivately from noncpopyable, remove warnings

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1932 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-04-17 14:20:21 +00:00
parent df199d6d56
commit 53cf203fb9
5 changed files with 33 additions and 18 deletions

View 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):

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

View 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

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

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