]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSpace.cpp
Linearize macros in box edit mode too.
[lyx.git] / src / mathed / InsetMathSpace.cpp
index 4cf1b944f878d166e0cf7ac4ef95560289e01169..0adce6ff28e3458b21813ee0c558903c9d102703 100644 (file)
@@ -121,6 +121,7 @@ Inset * InsetMathSpace::clone() const
 
 void InsetMathSpace::metrics(MetricsInfo & mi, Dimension & dim) const
 {
+       Changer dummy = mi.base.changeEnsureMath();
        dim.asc = 4;
        dim.des = 0;
        if (space_info[space_].custom)
@@ -132,6 +133,7 @@ void InsetMathSpace::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetMathSpace::draw(PainterInfo & pi, int x, int y) const
 {
+       Changer dummy = pi.base.changeEnsureMath();
        // Sadly, HP-UX CC can't handle that kind of initialization.
        // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
        if (!space_info[space_].visible)
@@ -303,8 +305,6 @@ bool InsetMathSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
        case LFUN_MOUSE_RELEASE:
-       case LFUN_MOUSE_PRESS:
-       case LFUN_MOUSE_MOTION:
                status.setEnabled(true);
                return true;
        default:
@@ -330,18 +330,13 @@ void InsetMathSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_MOUSE_RELEASE:
-               if (cmd.button() == mouse_button::button1) {
+               if (cmd.button() == mouse_button::button1 && !cur.selection()) {
                        showInsetDialog(&cur.bv());
                        break;
                }
                cur.undispatched();
                break;
 
-       case LFUN_MOUSE_PRESS:
-       case LFUN_MOUSE_MOTION:
-               // eat other mouse commands
-               break;
-
        default:
                InsetMath::doDispatch(cur, cmd);
                break;