]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.cpp
Inset::addToToc(): change signature. Use DocIterator instead of ParConstIterator...
[lyx.git] / src / insets / InsetCaption.cpp
index 241e147820e8e000f095f2acc8e15a5b627ed53d..dafaddef13740068d36c337105285c0934db5542 100644 (file)
@@ -102,16 +102,16 @@ void InsetCaption::setCustomLabel(docstring const & label)
 }
 
 
-void InsetCaption::addToToc(ParConstIterator const & cpit) const
+void InsetCaption::addToToc(DocIterator const & cpit)
 {
        if (type_.empty())
                return;
 
-       ParConstIterator pit = cpit;
-       pit.push_back(*this);
+       DocIterator pit = cpit;
+       pit.push_back(CursorSlice(*this));
 
        Toc & toc = buffer().tocBackend().toc(type_);
-       docstring const str = full_label_ + ". " + pit->asString(false);
+       docstring const str = full_label_ + ". " + text_.getPar(0).asString(false);
        toc.push_back(TocItem(pit, 0, str));
 }
 
@@ -270,6 +270,14 @@ int InsetCaption::getOptArg(odocstream & os,
 }
 
 
+int InsetCaption::getCaptionText(odocstream & os,
+                       OutputParams const & runparams) const
+{
+       os << full_label_ << ' ';
+       return InsetText::plaintext(os, runparams);
+}
+
+
 void InsetCaption::updateLabels(ParIterator const & it)
 {
        DocumentClass const & tclass = buffer().params().documentClass();