]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSpace.cpp
Fix creationCode() of GuiPrintNomencl
[lyx.git] / src / mathed / InsetMathSpace.cpp
index 39f3147bf1b3603864260e802beced96fcc2f29d..88aae1d4a66a85771e783ba88e7aa93b58a561d6 100644 (file)
@@ -75,7 +75,7 @@ SpaceInfo space_info[] = {
 int const nSpace = sizeof(space_info)/sizeof(SpaceInfo);
 int const defaultSpace = 4;
 
-} // anon namespace
+} // namespace
 
 InsetMathSpace::InsetMathSpace()
        : space_(defaultSpace)
@@ -208,14 +208,14 @@ void InsetMathSpace::mathmlize(MathStream & ms) const
                ss << si.width;
                l = ss.str() + "px";
        }
-       
+
        ms << "<mspace";
        if (!l.empty())
                ms << " width=\"" << from_ascii(l) << "\"";
        ms << " />";
 }
 
-       
+
 void InsetMathSpace::htmlize(HtmlStream & ms) const
 {
        SpaceInfo const & si = space_info[space_];
@@ -246,7 +246,7 @@ void InsetMathSpace::htmlize(HtmlStream & ms) const
        case InsetSpaceParams::CUSTOM:
        case InsetSpaceParams::CUSTOM_PROTECTED: {
                string l = length_.asHTMLString();
-               ms << MTag("span", "width='" + l + "'") 
+               ms << MTag("span", "width='" + l + "'")
                   << from_ascii("&nbsp;") << ETag("span");
                break;
        }
@@ -259,7 +259,7 @@ void InsetMathSpace::htmlize(HtmlStream & ms) const
        }
 }
 
-       
+
 void InsetMathSpace::normalize(NormalStream & os) const
 {
        os << "[space " << int(space_) << "] ";
@@ -305,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:
@@ -332,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;