}
-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;
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);
}