]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
Pure HTML output for math macros.
[lyx.git] / src / insets / InsetNote.cpp
index 89d789c04eb0d923f2625221b8a4230b1c9bc3f6..de03d61b6b46a4e95e5f94daa78a9e6472ecf043 100644 (file)
@@ -27,7 +27,7 @@
 #include "InsetIterator.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
-#include "MetricsInfo.h"
+#include "LyXRC.h"
 #include "OutputParams.h"
 #include "ParIterator.h"
 #include "TextClass.h"
@@ -115,7 +115,7 @@ void InsetNoteParams::read(Lexer & lex)
 //
 /////////////////////////////////////////////////////////////////////
 
-InsetNote::InsetNote(Buffer const & buf, string const & label)
+InsetNote::InsetNote(Buffer * buf, string const & label)
        : InsetCollapsable(buf)
 {
        params_.type = notetranslator().find(label);
@@ -320,12 +320,12 @@ int InsetNote::docbook(odocstream & os, OutputParams const & runparams_in) const
 }
 
 
-docstring InsetNote::xhtml(odocstream & os, OutputParams const & rp) const
+docstring InsetNote::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 {
        if (params_.type == InsetNoteParams::Note)
                return docstring();
 
-       return InsetCollapsable::xhtml(os, rp);
+       return InsetCollapsable::xhtml(xs, rp);
 }
 
 
@@ -351,6 +351,11 @@ docstring InsetNote::contextMenu(BufferView const &, int, int) const
        return from_ascii("context-note");
 }
 
+bool InsetNote::allowSpellCheck() const
+{
+       return (params_.type == InsetNoteParams::Greyedout || lyxrc.spellcheck_notes);
+}
+
 
 string InsetNote::params2string(InsetNoteParams const & params)
 {
@@ -384,37 +389,4 @@ void InsetNote::string2params(string const & in, InsetNoteParams & params)
 }
 
 
-bool mutateNotes(Cursor & cur, string const & source, string const & target)
-{
-       InsetNoteParams::Type typeSrc = notetranslator().find(source);
-       InsetNoteParams::Type typeTrt = notetranslator().find(target);
-       // syntax check of arguments
-       string src = notetranslator().find(typeSrc);
-       string trt = notetranslator().find(typeTrt);
-       if (src != source || trt != target)
-               return false;
-
-       // did we found some conforming inset?
-       bool ret = false;
-
-       cur.beginUndoGroup();
-       Inset & inset = cur.buffer()->inset();
-       InsetIterator it  = inset_iterator_begin(inset);
-       InsetIterator const end = inset_iterator_end(inset);
-       for (; it != end; ++it) {
-               if (it->lyxCode() == NOTE_CODE) {
-                       InsetNote & ins = static_cast<InsetNote &>(*it);
-                       if (ins.params().type == typeSrc) {
-                               cur.buffer()->undo().recordUndo(it);
-                               FuncRequest fr(LFUN_INSET_MODIFY, "note Note " + target);
-                               ins.dispatch(cur, fr);
-                               ret = true;
-                       }
-               }
-       }
-       cur.endUndoGroup();
-
-       return ret;
-}
-
 } // namespace lyx