- ParConstIterator const ref_pit(it->second);
- toc.push_back(TocItem(ref_pit, 1, it->first->screenLabel()));
+ DocIterator const ref_pit(it->second);
+ if (it->first->lyxCode() == MATH_REF_CODE)
+ toc.push_back(TocItem(ref_pit, 1,
+ it->first->asInsetMath()->asRefInset()->screenLabel()));
+ else
+ toc.push_back(TocItem(ref_pit, 1,
+ static_cast<InsetRef *>(it->first)->screenLabel()));
+ }
+}
+
+
+bool InsetLabel::getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const
+{
+ bool enabled;
+ switch (cmd.action()) {
+ case LFUN_LABEL_INSERT_AS_REF:
+ case LFUN_LABEL_COPY_AS_REF:
+ enabled = true;
+ break;
+ default:
+ return InsetCommand::getStatus(cur, cmd, status);