]> git.lyx.org Git - lyx.git/commitdiff
drop extra {} in "obvious" cases
authorAndré Pönitz <poenitz@gmx.net>
Wed, 31 Oct 2001 15:14:22 +0000 (15:14 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 31 Oct 2001 15:14:22 +0000 (15:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2954 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/BUGS
src/mathed/math_parser.C
src/mathed/math_scriptinset.C

index bd9af09116a9e136bbc595c37323699542457758..81bbe4122fec60f499887f1bdabffcbf61e9e1d1 100644 (file)
@@ -155,8 +155,8 @@ Marcus (Suran@gmx.net)
 - If the math-panel has the focus I can type text but not switch into
   math-mode or use some of the other keyboard-shortcuts.
 
-- In the default-configuration there are shortcuts for al greek characters
-  _except_ varphi wich is used extensively as a default-variable-name.
+// - In the default-configuration there are shortcuts for al greek characters
+//  _except_ varphi wich is used extensively as a default-variable-name.
 
 
 From: Álvaro Tejero Cantero <alvaro@antalia.com>
@@ -206,8 +206,8 @@ From: 
  majority of cases.
  
  
-- undo-redo seems too coarse in math-mode. You end up losing substantial 
- fragments of your formula. I hate that when it affects tensors,;).
+// - undo-redo seems too coarse in math-mode. You end up losing substantial 
+//  fragments of your formula. I hate that when it affects tensors,;).
  
 - cut&paste inside math-mode doesn't work the X fashion (middle button doesn't 
  paste anything).
index 7b74c6dda33bf5ce4e27eb3b30ed0faaf6a77283..498daee1d2947edb155fa818a02e2e7f54a563bf 100644 (file)
@@ -724,8 +724,18 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
                }
 
                else if (t.cat() == catBegin) {
-                       array.push_back(MathAtom(new MathBraceInset));
-                       parse_into(array.back()->cell(0), FLAG_BRACE_LAST);
+                       MathArray ar;
+                       parse_into(ar, FLAG_BRACE_LAST);
+#ifndef WITH_WARNINGS
+#warning this might be wrong in general!
+#endif
+                       // ignore braces around simple items
+                       if (ar.size() == 1 || (ar.size() == 2 && ar.back()->asScriptInset())) {
+                               array.push_back(ar);
+                       } else {
+                               array.push_back(MathAtom(new MathBraceInset));
+                               array.back()->cell(0).swap(ar);
+                       }
                }
 
                else if (t.cat() == catEnd) {
index d8eed9394975f5e69015abcd2396ec87c3ec8506..a66ec9c67624912ff435eb340c65745d484e0484 100644 (file)
@@ -278,7 +278,7 @@ void MathScriptInset::writeNormal(MathInset const * nuc, ostream & os) const
        if (u && d) {
                os << "[sup [sub " << osb.str() << " ";
                down().data_.writeNormal(os);
-               os << "]";
+               os << "] ";
                up().data_.writeNormal(os);
                os << ']';
        } else if (u) {