]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetNote.cpp
index dc57f5ffff7da8ef804a1bfe14354a61dd4a2fd4..ab90288c6beb5530ad33f553567693c5c5bbf29d 100644 (file)
@@ -20,7 +20,6 @@
 #include "BufferParams.h"
 #include "Counters.h"
 #include "Cursor.h"
-#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Exporter.h"
 #include "FuncRequest.h"
@@ -34,6 +33,7 @@
 #include "TextClass.h"
 #include "TocBackend.h"
 
+#include "support/debug.h"
 #include "support/docstream.h"
 #include "support/Translator.h"
 
@@ -138,7 +138,7 @@ docstring const InsetNote::editMessage() const
 
 docstring InsetNote::name() const 
 {
-       return from_ascii(string("Note") + string(":") + string(notetranslator().find(params_.type)));
+       return from_ascii("Note:" + notetranslator().find(params_.type));
 }
 
 
@@ -220,14 +220,16 @@ void InsetNote::updateLabels(Buffer const & buf, ParIterator const & it)
 }
 
 
-void InsetNote::addToToc(TocList & toclist, Buffer const & buf, ParConstIterator const &) const
+void InsetNote::addToToc(Buffer const & buf,
+       ParConstIterator const & cpit) const
 {
-       ParConstIterator pit = par_const_iterator_begin(*this);
+       ParConstIterator pit = cpit;
+       pit.push_back(*this);
 
-       Toc & toc = toclist["note"];
-       // FIXME: we probably want the note type too.
+       Toc & toc = buf.tocBackend().toc("note");
        docstring str;
-       str = getNewLabel(str);
+       str = notetranslator_loc().find(params_.type) + from_ascii(": ")
+               + getNewLabel(str);
        toc.push_back(TocItem(pit, 0, str));
 }