From 9efc77e4dbaf6becfdfee8f8b005161838c1a243 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 12 Aug 2004 21:29:21 +0000 Subject: [PATCH] fix #928 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8889 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 2 ++ src/mathed/math_hullinset.C | 16 ++++++++++++++-- src/mathed/math_parser.C | 17 ++++++++++++++--- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index d2051c28c5..79c21370bf 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -2,6 +2,8 @@ 2004-08-12 André Pönitz * math_nestinset.C: Fix #1249 + + * math_parser.C: Fix: #928 2004-07-24 Lars Gullik Bjonnes diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index ec3aa2c020..77fd77d9c8 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -1013,8 +1013,20 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd, istringstream is(cmd.argument); string s; is >> s; - if ((s == "append-column" || s == "delete-column") - && (type_ == "eqnarray" || type_ == "simple")) + if ((type_ == "simple" || type_ == "equation") + && (s == "append-column" + || s == "delete-column" + || s == "swap-column" + || s == "copy-column" + || s == "delete-column" + || s == "append-row" + || s == "delete-row" + || s == "swap-row" + || s == "copy-row")) + return false; + if ((type_ == "eqnarray") + && (s == "appen-column" + || s == "delete-column")) return false; return MathGridInset::getStatus(cur, cmd, flag); } diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 0264350e87..b5746affca 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -144,7 +144,8 @@ enum { FLAG_EQUATION = 1 << 9, // next \] leaves the loop FLAG_SIMPLE2 = 1 << 10, // next \) leaves the loop FLAG_OPTION = 1 << 11, // read [...] style option - FLAG_BRACED = 1 << 12 // read {...} style argument + FLAG_BRACED = 1 << 12, // read {...} style argument + FLAG_SKIPSPACE = 1 << 13 // skip spaces }; @@ -584,9 +585,17 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, lyxerr << endl; #endif + if (flags & FLAG_SKIPSPACE) { + if (t.cat() == catSpace || t.cat() == catNewline) + continue; + pop_back(); + return; + } + + if (flags & FLAG_ITEM) { - if (t.cat() == catBegin) { + if (t.cat() == catBegin) { // skip the brace and collect everything to the next matching // closing brace parse1(grid, FLAG_BRACE_LAST, mode, numbered); @@ -1203,8 +1212,10 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, // start = 1; // at.nucleus()->cell(0) = opt; //} - for (MathInset::idx_type i = start; i < at->nargs(); ++i) + for (MathInset::idx_type i = start; i < at->nargs(); ++i) { parse(at.nucleus()->cell(i), FLAG_ITEM, m); + parse1(grid, FLAG_SKIPSPACE, mode, numbered); + } cell->push_back(at); } } -- 2.39.5