]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_casesinset.C
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / math_casesinset.C
index 595a3d0790908fc9dd7e21bf50ab61f8e8b7417e..a21a0bfa106eb109cd03113d49ac0ece8e3c5329 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "support/lstrings.h"
 
-#include <sstream>
 
 using lyx::support::bformat;
 
@@ -32,7 +31,6 @@ using std::endl;
 using std::max;
 using std::min;
 using std::swap;
-using std::istringstream;
 using std::string;
 
 using std::auto_ptr;
@@ -60,7 +58,7 @@ void MathCasesInset::metrics(MetricsInfo & mi, Dimension & dim) const
 void MathCasesInset::draw(PainterInfo & pi, int x, int y) const
 {
        mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 6, dim_.height(), "{");
-       MathGridInset::draw(pi, x + 8, y);
+       MathGridInset::drawWithMargin(pi, x, y, 8, 0);
        setPosCache(pi, x, y);
 }
 
@@ -71,9 +69,7 @@ void MathCasesInset::doDispatch(LCursor & cur, FuncRequest & cmd)
        switch (cmd.action) {
        case LFUN_TABULAR_FEATURE: {
                recordUndo(cur);
-               istringstream is(cmd.argument);
-               string s;
-               is >> s; 
+               string const s = cmd.argument;
                if (s == "add-vline-left" || s == "add-vline-right") {
                        cur.undispatched();
                        break;
@@ -90,9 +86,7 @@ bool MathCasesInset::getStatus(LCursor & cur, FuncRequest const & cmd,
 {
        switch (cmd.action) {
        case LFUN_TABULAR_FEATURE: {
-               istringstream is(cmd.argument);
-               string s;
-               is >> s;
+               string const s = cmd.argument;
                if (s == "add-vline-left" || s == "add-vline-right") {
                        flag.enabled(false);
                        flag.message(bformat(