]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetGraphics.cpp
Make the generation of children's tocs more robust
[features.git] / src / insets / InsetGraphics.cpp
index 4d850b59db42c6c1e767210433cf0db920de3e21..b41d72bc70083d132742ee48ef3b851aeb576251 100644 (file)
@@ -1036,11 +1036,13 @@ void InsetGraphics::editGraphics(InsetGraphicsParams const & p) const
 
 
 void InsetGraphics::addToToc(DocIterator const & cpit, bool output_active,
-                                                        UpdateType) const
+                                                        UpdateType, TocBackend & backend) const
 {
        //FIXME UNICODE
        docstring const str = from_utf8(params_.filename.onlyFileName());
-       buffer().tocBackend().toc("graphics")->push_back(TocItem(cpit, 0, str, output_active));
+       TocBuilder & b = backend.builder("graphics");
+       b.pushItem(cpit, str, output_active);
+       b.pop();
 }