mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
* at least return a valid template on parse error, but:
FIXME: The macro template does not make sense after this. The whole parsing should not be in a constructor which has no chance to report failure. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22214 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8d7ea1ceaa
commit
2495f278ba
@ -119,7 +119,8 @@ MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs,
|
|||||||
|
|
||||||
|
|
||||||
MathMacroTemplate::MathMacroTemplate(docstring const & str)
|
MathMacroTemplate::MathMacroTemplate(docstring const & str)
|
||||||
: InsetMathNest(3), numargs_(0)
|
: InsetMathNest(3), numargs_(0), optionals_(0),
|
||||||
|
type_(MacroTypeNewcommand)
|
||||||
{
|
{
|
||||||
initMath();
|
initMath();
|
||||||
|
|
||||||
@ -127,6 +128,10 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str)
|
|||||||
mathed_parse_cell(ar, str);
|
mathed_parse_cell(ar, str);
|
||||||
if (ar.size() != 1 || !ar[0]->asMacroTemplate()) {
|
if (ar.size() != 1 || !ar[0]->asMacroTemplate()) {
|
||||||
lyxerr << "Cannot read macro from '" << ar << "'" << endl;
|
lyxerr << "Cannot read macro from '" << ar << "'" << endl;
|
||||||
|
asArray(from_ascii("invalidmacro"), cell(0));
|
||||||
|
// FIXME: The macro template does not make sense after this.
|
||||||
|
// The whole parsing should not be in a constructor which
|
||||||
|
// has no chance to report failure.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
operator=( *(ar[0]->asMacroTemplate()) );
|
operator=( *(ar[0]->asMacroTemplate()) );
|
||||||
|
Loading…
Reference in New Issue
Block a user