InsetMathNest.cpp: allow to enter starred commands (fixed bug 4585)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@23297 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2008-02-27 23:33:03 +00:00
parent 389b03c870
commit f7a0bff71f
4 changed files with 17 additions and 5 deletions

View File

@ -1253,7 +1253,11 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type c)
return true;
}
if (isAlphaASCII(c)) {
// do not finish macro for known * commands
WordList const & mwl = mathedWordList();
bool star_macro = c == '*'
&& (mwl.find(name.substr(1) + "*") != mwl.end());
if (isAlphaASCII(c) || star_macro) {
cur.activeMacro()->setName(name + docstring(1, c));
return true;
}

View File

@ -79,9 +79,6 @@ bool has_math_fonts;
namespace {
// file scope
typedef std::map<docstring, latexkeys> WordList;
WordList theWordList;
@ -233,6 +230,12 @@ void initSymbols()
} // namespace anon
WordList const & mathedWordList()
{
return theWordList;
}
void initMath()
{

View File

@ -12,7 +12,10 @@
#ifndef MATH_FACTORY_H
#define MATH_FACTORY_H
#include "MathParser.h"
#include "support/docstring.h"
#include <map>
#include <string>
namespace lyx {
@ -30,6 +33,8 @@ MathAtom createInsetMath(char const * const);
*/
bool createInsetMath_fromDialogStr(docstring const &, MathData &);
typedef std::map<docstring, latexkeys> WordList;
WordList const & mathedWordList();
} // namespace lyx

View File

@ -60,7 +60,7 @@ What's new
* USER INTERFACE:
- Allow to enter starred math commands like "\tag*" (bug 4585).
* DOCUMENTATION