]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetNote.cpp
index 7e408255f7b38fe3ea16f7916d84351eda594823..50382349bdb20fffcdb944bbcec2e41a440a0777 100644 (file)
@@ -40,7 +40,6 @@
 namespace lyx {
 
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -134,9 +133,9 @@ InsetNote::~InsetNote()
 }
 
 
-auto_ptr<Inset> InsetNote::doClone() const
+Inset * InsetNote::clone() const
 {
-       return auto_ptr<Inset>(new InsetNote(*this));
+       return new InsetNote(*this);
 }
 
 
@@ -184,31 +183,6 @@ void InsetNote::setButtonLabel()
 {
        docstring const label = notetranslator_loc().find(params_.type);
        setLabel(label);
-       setLabelFont(layout_.labelfont);
-}
-
-
-Color_color InsetNote::backgroundColor() const
-{
-       Color_color c;
-       switch (params_.type) {
-       case InsetNoteParams::Note:
-               c = Color::notebg;
-               break;
-       case InsetNoteParams::Comment:
-               c = Color::commentbg;
-               break;
-       case InsetNoteParams::Greyedout:
-               c = Color::greyedoutbg;
-               break;
-       case InsetNoteParams::Framed:
-               c = Color::greyedoutbg;
-               break;
-       case InsetNoteParams::Shaded:
-               c = Color::shadedbg;
-               break;
-       }
-       return c;
 }
 
 
@@ -233,14 +207,6 @@ void InsetNote::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_DIALOG_UPDATE:
                InsetNoteMailer(*this).updateDialog(&cur.bv());
                break;
-
-       case LFUN_MOUSE_RELEASE:
-               if (cmd.button() == mouse_button::button3 && hitButton(cmd))
-                       InsetNoteMailer(*this).showDialog(&cur.bv());
-               else
-                       InsetCollapsable::doDispatch(cur, cmd);
-               break;
-
        default:
                InsetCollapsable::doDispatch(cur, cmd);
                break;
@@ -279,23 +245,14 @@ int InsetNote::latex(Buffer const & buf, odocstream & os,
                return 0;
 
        OutputParams runparams(runparams_in);
-       string type;
        if (params_.type == InsetNoteParams::Comment) {
-               type = "comment";
                runparams.inComment = true;
                // Ignore files that are exported inside a comment
                runparams.exportdata.reset(new ExportData);
-       } else if (params_.type == InsetNoteParams::Greyedout)
-               type = "lyxgreyedout";
-       else if (params_.type == InsetNoteParams::Framed)
-               type = "framed";
-       else if (params_.type == InsetNoteParams::Shaded)
-               type = "shaded";
+       } 
 
        odocstringstream ss;
-       ss << "%\n\\begin{" << from_ascii(type) << "}\n";
-       InsetText::latex(buf, ss, runparams);
-       ss << "\n\\end{" << from_ascii(type) << "}\n";
+       InsetCollapsable::latex(buf, ss, runparams);
        // the space after the comment in 'a[comment] b' will be eaten by the
        // comment environment since the space before b is ignored with the
        // following latex output: