]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetNote.cpp
index ac98846b06c2ae56ef670db38f3bf36684667885..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);
 }
 
 
@@ -187,30 +186,6 @@ void InsetNote::setButtonLabel()
 }
 
 
-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;
-}
-
-
 bool InsetNote::showInsetDialog(BufferView * bv) const
 {
        InsetNoteMailer(const_cast<InsetNote &>(*this)).showDialog(bv);
@@ -232,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;
@@ -285,10 +252,7 @@ int InsetNote::latex(Buffer const & buf, odocstream & os,
        } 
 
        odocstringstream ss;
-       //ss << "%\n\\begin{" << from_ascii(type) << "}\n";
-       ss << "%\n\\begin{" << from_ascii(layout_.latexname) << "}\n";
-       InsetText::latex(buf, ss, runparams);
-       ss << "\n\\end{" << from_ascii(layout_.latexname) << "}\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: