#if 0
// We will enably this check again when the compability
// code is removed from Buffer::Read (Lgb)
- string const token = lex.GetString();
- if (token != "Caption") {
- lyxerr << "InsetCaption::Read: consistency check failed."
- << endl;
- }
+ lex.setContext("InsetCaption::Read: consistency check");
+ lex >> "Caption";
#endif
InsetText::read(lex);
}
}
-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));
}
status.enabled(cur.paragraph().insetList().find(OPTARG_CODE) == -1);
return true;
+ case LFUN_INSET_TOGGLE:
+ // pass back to owner
+ cur.undispatched();
+ return false;
+
default:
return InsetText::getStatus(cur, cmd, status);
}
}
+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();