]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetCaption.cpp
Make the generation of children's tocs more robust
[features.git] / src / insets / InsetCaption.cpp
index 05b7dc7766b2b79d0167c286b5989d0dbeebda0f..7570fa52fa1ec1cc6bf12e95cd947db6e078c7d8 100644 (file)
@@ -32,6 +32,8 @@
 #include "OutputParams.h"
 #include "Paragraph.h"
 #include "ParIterator.h"
+#include "TexRow.h"
+#include "texstream.h"
 #include "TextClass.h"
 #include "TextMetrics.h"
 #include "TocBackend.h"
@@ -92,7 +94,7 @@ void InsetCaption::setCustomLabel(docstring const & label)
 
 
 void InsetCaption::addToToc(DocIterator const & cpit, bool output_active,
-                                                       UpdateType utype) const
+                                                       UpdateType utype, TocBackend & backend) const
 {
        string const & type = floattype_.empty() ? "senseless" : floattype_;
        DocIterator pit = cpit;
@@ -107,9 +109,9 @@ void InsetCaption::addToToc(DocIterator const & cpit, bool output_active,
                str = full_label_;
                text().forOutliner(str, length);
        }
-       buffer().tocBackend().builder(type).captionItem(pit, str, output_active);
+       backend.builder(type).captionItem(pit, str, output_active);
        // Proceed with the rest of the inset.
-       InsetText::addToToc(cpit, output_active, utype);
+       InsetText::addToToc(cpit, output_active, utype, backend);
 }