]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnote.C
ws changes only
[lyx.git] / src / insets / insetnote.C
index bc508810282e88691c5cdaea38b0a132327b4bca..051b27d6d8cc89d558e9b7ce86c367d4c5a29cb9 100644 (file)
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
+#include "LColor.h"
 #include "lyxlex.h"
 #include "metricsinfo.h"
+#include "paragraph.h"
 
 #include "support/std_sstream.h"
 
+
+using std::string;
 using std::auto_ptr;
+using std::istringstream;
 using std::ostream;
+using std::ostringstream;
 
 
 void InsetNote::init()
@@ -39,7 +45,6 @@ InsetNote::InsetNote(BufferParams const & bp, string const & label)
 {
        params_.type = label;
        init();
-       setButtonLabel();
 }
 
 
@@ -50,7 +55,7 @@ InsetNote::InsetNote(InsetNote const & in)
 }
 
 
-InsetNote::~InsetNote() // MV
+InsetNote::~InsetNote()
 {
        InsetNoteMailer mailer("note", *this);
        mailer.hideDialog();
@@ -112,7 +117,7 @@ void InsetNote::metrics(MetricsInfo & mi, Dimension & dim) const
        // Contrary to Greyedout, these cannot be construed as part of the
        // running text: make them stand on their own
        if (params_.type == "Note" || params_.type == "Comment")
-               if (!collapsed_)
+               if (isOpen())
                        dim.wid = mi.base.textwidth;
        dim_ = dim;
 }
@@ -132,9 +137,7 @@ dispatch_result InsetNote::localDispatch(FuncRequest const & cmd)
        switch (cmd.action) {
 
        case LFUN_INSET_MODIFY: {
-               InsetNoteParams params;
-               InsetNoteMailer::string2params(cmd.argument, params);
-               params_.type = params.type;
+               InsetNoteMailer::string2params(cmd.argument, params_);
                setButtonLabel();
                bv->updateInset(this);
                return DISPATCHED;
@@ -184,7 +187,7 @@ int InsetNote::latex(Buffer const & buf, ostream & os,
        } else if (pt == "Greyedout") {
                os << "%\n\\end{lyxgreyedout}\n";
                i += 4;
-       } 
+       }
        return i;
 }
 
@@ -272,7 +275,7 @@ string const InsetNoteMailer::params2string(string const & name,
        ostringstream data;
        data << name << ' ';
        params.write(data);
-       return STRCONV(data.str());
+       return data.str();
 }
 
 
@@ -284,7 +287,7 @@ void InsetNoteMailer::string2params(string const & in,
        if (in.empty())
                return;
 
-       istringstream data(STRCONV(in));
+       istringstream data(in);
        LyXLex lex(0,0);
        lex.setStream(data);
        params.read(lex);