]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnote.C
* BufferParams:
[lyx.git] / src / insets / insetnote.C
index b840955032cdb0b16831769f57f38ed2e1158825..38250c38af6004c44fd9ff7cc6bf8c0430587b8e 100644 (file)
@@ -105,7 +105,7 @@ void InsetNoteParams::read(LyXLex & lex)
 {
        string label;
        lex >> label;
-       if (lex)
+       if (lex.isOK())
                type = notetranslator().find(label);
 }
 
@@ -290,54 +290,54 @@ int InsetNote::latex(Buffer const & buf, odocstream & os,
 
        docstring const str = ss.str();
        os << str;
+       runparams_in.encoding = runparams.encoding;
        // Return how many newlines we issued.
        return int(lyx::count(str.begin(), str.end(), '\n'));
 }
 
 
-int InsetNote::docbook(Buffer const & buf, odocstream & os,
-                      OutputParams const & runparams_in) const
+int InsetNote::plaintext(Buffer const & buf, odocstream & os,
+                         OutputParams const & runparams_in) const
 {
        if (params_.type == InsetNoteParams::Note)
                return 0;
 
        OutputParams runparams(runparams_in);
        if (params_.type == InsetNoteParams::Comment) {
-               os << "<remark>\n";
                runparams.inComment = true;
                // Ignore files that are exported inside a comment
                runparams.exportdata.reset(new ExportData);
        }
+       os << '[' << _("note") << ":\n";
+       InsetText::plaintext(buf, os, runparams);
+       os << "\n]";
 
-       int const n = InsetText::docbook(buf, os, runparams);
-
-       if (params_.type == InsetNoteParams::Comment)
-               os << "\n</remark>\n";
-
-       // Return how many newlines we issued.
-       //return int(count(str.begin(), str.end(), '\n'));
-        return n + 1 + 2;
+       return PLAINTEXT_NEWLINE + 1; // one char on a separate line
 }
 
 
-int InsetNote::plaintext(Buffer const & buf, odocstream & os,
-                        OutputParams const & runparams_in) const
+int InsetNote::docbook(Buffer const & buf, odocstream & os,
+                       OutputParams const & runparams_in) const
 {
        if (params_.type == InsetNoteParams::Note)
                return 0;
 
        OutputParams runparams(runparams_in);
        if (params_.type == InsetNoteParams::Comment) {
+               os << "<remark>\n";
                runparams.inComment = true;
                // Ignore files that are exported inside a comment
                runparams.exportdata.reset(new ExportData);
        }
-       os << "[";
-       int const nlines = InsetText::plaintext(buf, os, runparams);
-       os << "]";
+
+       int const n = InsetText::docbook(buf, os, runparams);
+
+       if (params_.type == InsetNoteParams::Comment)
+               os << "\n</remark>\n";
 
        // Return how many newlines we issued.
-       return nlines;
+       //return int(count(str.begin(), str.end(), '\n'));
+        return n + 1 + 2;
 }