]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
Inset::addToToc(): change signature. Use DocIterator instead of ParConstIterator...
[lyx.git] / src / insets / InsetNote.cpp
index c764f801ee9ea5494587160c56ee4e395f80dbc9..c8dededc59efd2b55677973ab1e85fc4de771cff 100644 (file)
@@ -221,19 +221,10 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetNote::updateLabels(ParIterator const & it)
+void InsetNote::addToToc(DocIterator const & cpit)
 {
-       DocumentClass const & tclass = buffer().params().documentClass();
-       Counters savecnt = tclass.counters();
-       InsetCollapsable::updateLabels(it);
-       tclass.counters() = savecnt;
-}
-
-
-void InsetNote::addToToc(ParConstIterator const & cpit) const
-{
-       ParConstIterator pit = cpit;
-       pit.push_back(*this);
+       DocIterator pit = cpit;
+       pit.push_back(CursorSlice(*this));
 
        Toc & toc = buffer().tocBackend().toc("note");
        docstring str;
@@ -370,22 +361,8 @@ void InsetNote::string2params(string const & in, InsetNoteParams & params)
        istringstream data(in);
        Lexer lex;
        lex.setStream(data);
-
-       string name;
-       lex >> name;
-       if (!lex || name != "note") {
-               LYXERR0("Expected arg 1 to be \"note\" in " << in);
-               return;
-       }
-
-       // This is part of the inset proper that is usually swallowed
-       // by Text::readInset
-       string id;
-       lex >> id;
-       if (!lex || id != "Note") {
-               LYXERR0("Expected arg 1 to be \"Note\" in " << in);
-               return;
-       }
+       lex.setContext("InsetNote::string2params");
+       lex >> "note" >> "Note";
 
        params.read(lex);
 }