]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnote.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetnote.C
index ce4188331e10514399765663d45c9dfc1acda6e8..92a79b09f7d93cdd122b9b8010ac4daa732e5626 100644 (file)
@@ -132,8 +132,7 @@ dispatch_result InsetNote::localDispatch(FuncRequest const & cmd)
                InsetNoteMailer("note", *this).updateDialog(bv);
                return DISPATCHED;
        case LFUN_MOUSE_RELEASE:
-               if (cmd.button() == mouse_button::button3 && cmd.x < button_length
-                                       && cmd.y >= button_top_y && cmd.y <= button_bottom_y) {
+               if (cmd.button() == mouse_button::button3 && hitButton(cmd)) {
                        InsetNoteMailer("note", *this).showDialog(bv);
                        return DISPATCHED;
                }
@@ -151,9 +150,11 @@ int InsetNote::latex(Buffer const * buf, ostream & os,
 
        int i = 0;
        if (pt == "Comment")
-               os << "%\n\\begin{comment}\n"; // remember to validate
+                // verbatim
+               os << "%\n\\begin{comment}\n";
        else if (pt == "Greyedout")
-               os << "%\n\\color[gray]{0.8}";
+                // we roll our own macro
+               os << "%\n\\begin{lyxgreyedout}\n";
 
        if (pt != "Note")
                i = inset.latex(buf, os, runparams);
@@ -162,7 +163,7 @@ int InsetNote::latex(Buffer const * buf, ostream & os,
                os << "%\n\\end{comment}\n";
                i += 3;
        } else if (pt == "Greyedout") {
-               os << "\\normalcolor%\n}";
+               os << "%\n\\end{lyxgreyedout}\n";
                i += 2;
        }
        return i;
@@ -224,8 +225,10 @@ void InsetNote::validate(LaTeXFeatures & features) const
 {
        if (params_.type == "Comment")
                features.require("verbatim");
-       if (params_.type == "Greyedout")
+       if (params_.type == "Greyedout") {
                features.require("color");
+               features.require("lyxgreyedout");
+       }
        inset.validate(features);
 }