From 46262e6298f04c797d54d892dd574961d9ce91c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 13 Aug 2004 09:31:48 +0000 Subject: [PATCH] fix #1589 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8892 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/cursor.C | 6 +++++- src/mathed/ChangeLog | 7 ++++--- src/mathed/math_factory.C | 1 + src/mathed/math_nestinset.C | 8 +++----- src/metricsinfo.C | 3 ++- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9a0e9d5945..c496dc6f7b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,8 @@ +2004-08-13 André Pönitz + + * cursor.C: macroModeClose: use plainInsert instead of niceInsert. + 2004-08-12 André Pönitz * text3.C: take out the 'cursor right' form insertInset and only diff --git a/src/cursor.C b/src/cursor.C index 82a0a58b31..b29605efe3 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -711,13 +711,17 @@ void LCursor::macroModeClose() return; string const name = s.substr(1); + lyxerr << "creating macro of name '" << name << "'" << endl; // prevent entering of recursive macros + // FIXME: this is only a weak attempt... only prevents immediate + // recursion InsetBase const * macro = innerInsetOfType(InsetBase::MATHMACRO_CODE); if (macro && macro->getInsetName() == name) lyxerr << "can't enter recursive macro" << endl; - niceInsert(createMathInset(name)); + //niceInsert(createMathInset(name)); + plainInsert(createMathInset(name)); } diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 79c21370bf..f616f76382 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,4 +1,5 @@ + 2004-08-12 André Pönitz * math_nestinset.C: Fix #1249 @@ -8,9 +9,9 @@ 2004-07-24 Lars Gullik Bjonnes * math_support.C, math_parser.C, math_nestinset.C, math_macrotable.C: - * math_hullinset.C, math_gridinset.C, math_factory.C: - * math_extern.C, math_autocorrect.C, math_arrayinset.C: - * formulamacro.C, command_inset.C: change "support/std_sstream.h" + * math_hullinset.C, math_gridinset.C, math_factory.C: math_extern.C, + * math_autocorrect.C, math_arrayinset.C: formulamacro.C, + * command_inset.C: change "support/std_sstream.h" to 2004-07-24 Lars Gullik Bjonnes diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index 1b54db1285..7ec8c19dec 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -327,6 +327,7 @@ MathAtom createMathInset(string const & s) // return MathAtom(new MathMacro(s, // MacroTable::localMacros().get(s).numargs())); + lyxerr << "creating unknown inset '" << s << "'" << endl; return MathAtom(new MathUnknownInset(s)); } diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 183ecf7e9a..724e8420fb 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -442,8 +442,7 @@ void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd) cur.selHandle(cmd.action == LFUN_RIGHTSEL); cur.autocorrect() = false; cur.clearTargetX(); - if (cur.inMacroMode()) - cur.macroModeClose(); + cur.macroModeClose(); else if (cur.pos() != cur.lastpos() && cur.openable(cur.nextAtom())) { cur.pushLeft(*cur.nextAtom().nucleus()); cur.inset().idxFirst(cur); @@ -459,9 +458,8 @@ void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd) cur.selHandle(cmd.action == LFUN_LEFTSEL); cur.autocorrect() = false; cur.clearTargetX(); - if (cur.inMacroMode()) - cur.macroModeClose(); - else if (cur.pos() != 0 && cur.openable(cur.prevAtom())) { + cur.macroModeClose(); + if (cur.pos() != 0 && cur.openable(cur.prevAtom())) { cur.posLeft(); cur.push(*cur.nextAtom().nucleus()); cur.inset().idxLast(cur); diff --git a/src/metricsinfo.C b/src/metricsinfo.C index 60ba208a4f..b49eac04c8 100644 --- a/src/metricsinfo.C +++ b/src/metricsinfo.C @@ -121,7 +121,8 @@ ShapeChanger::~ShapeChanger() StyleChanger::StyleChanger(MetricsBase & mb, Styles style) : Changer(mb) { - static const int diff[4][4] = { { 0, 0, -3, -5 }, + static const int diff[4][4] = + { { 0, 0, -3, -5 }, { 0, 0, -3, -5 }, { 3, 3, 0, -2 }, { 5, 5, 2, 0 } }; -- 2.39.2