+ if (it->first->lyxCode() == MATH_REF_CODE)
+ toc.push_back(TocItem(ref_pit, 1,
+ it->first->asInsetMath()->asRefInset()->screenLabel(),
+ output_active));
+ else
+ toc.push_back(TocItem(ref_pit, 1,
+ static_cast<InsetRef *>(it->first)->getTOCString(),
+ output_active));
+ }
+}
+
+
+bool InsetLabel::getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const
+{
+ bool enabled;
+ switch (cmd.action()) {
+ case LFUN_LABEL_INSERT_AS_REFERENCE:
+ case LFUN_LABEL_COPY_AS_REFERENCE:
+ enabled = true;
+ break;
+ case LFUN_INSET_MODIFY:
+ if (cmd.getArg(0) == "changetype") {
+ // this is handled by InsetCommand,
+ // but not by InsetLabel.
+ enabled = false;
+ break;
+ }
+ default:
+ return InsetCommand::getStatus(cur, cmd, status);