+docstring InsetBibtex::getRefLabel() const
+{
+ if (buffer().masterParams().documentClass().hasLaTeXLayout("chapter"))
+ return buffer().B_("Bibliography");
+ return buffer().B_("References");
+}
+
+
+void InsetBibtex::addToToc(DocIterator const & cpit, bool output_active,
+ UpdateType, TocBackend & backend) const
+{
+ if (!prefixIs(to_utf8(getParam("options")), "bibtotoc"))
+ return;
+
+ docstring const str = getRefLabel();
+ TocBuilder & b = backend.builder("tableofcontents");
+ b.pushItem(cpit, str, output_active);
+ b.pop();
+}
+
+