void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd)
{
+ // Ctrl + click: go to label
+ if (cmd.action() == LFUN_MOUSE_RELEASE && cmd.modifier() == ControlModifier) {
+ lyx::dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"));
+ lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference")));
+ return;
+ }
+
string const inset = cmd.getArg(0);
string const arg = cmd.getArg(1);
string pstring;
}
}
- // Ctrl + click: go to label
- if (cmd.action() == LFUN_MOUSE_RELEASE && cmd.modifier() == ControlModifier) {
- lyx::dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"));
- lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference")));
- return;
- }
-
// otherwise not for us
if (pstring.empty())
return InsetCommand::doDispatch(cur, cmd);
void InsetRef::forOutliner(docstring & os, size_t const, bool const) const
{
- // There's no need for details in the TOC, and a long label
- // will just get in the way.
- os += '#';
+ // It's hard to know what to do here. Should we show XREF in the TOC?
+ // Or should we just show that there is one? For now, we do the former.
+ odocstringstream ods;
+ plaintext(ods, OutputParams(nullptr));
+ os += ods.str();
}
for (int i = 0; !types[i].latex_name.empty(); ++i) {
if (cmd == types[i].latex_name) {
label = _(types[i].short_gui_name);
+ // indicate plural and caps
+ if (cmd == "formatted") {
+ bool const isPlural = getParam("plural") == "true";
+ bool const isCaps = getParam("caps") == "true";
+ if (isPlural)
+ label += from_ascii("+");
+ if (isCaps) {
+ // up arrow (shift key) symbol
+ label += docstring(1, char_type(0x21E7));
+ }
+ }
+ label += from_ascii(": ");
break;
}
}
broken_ = true;
setBroken(broken_);
shared_ptr<Toc> toc = backend.toc("label");
- toc->push_back(TocItem(cpit, 0, screenLabel(), output_active));
+ if (TocBackend::findItem(*toc, 0, label) == toc->end())
+ toc->push_back(TocItem(cpit, 0, label, output_active, true));
+ toc->push_back(TocItem(cpit, 1, screenLabel(), output_active));
shared_ptr<Toc> toc2 = backend.toc("brokenrefs");
toc2->push_back(TocItem(cpit, 0, screenLabel(), output_active));
}
InsetRef::type_info const InsetRef::types[] = {
- { "ref", N_("Standard"), N_("Ref: ")},
- { "eqref", N_("Equation"), N_("EqRef: ")},
- { "pageref", N_("Page Number"), N_("Page: ")},
- { "vpageref", N_("Textual Page Number"), N_("TextPage: ")},
- { "vref", N_("Standard+Textual Page"), N_("Ref+Text: ")},
- { "nameref", N_("Reference to Name"), N_("NameRef: ")},
- { "formatted", N_("Formatted"), N_("Format: ")},
- { "labelonly", N_("Label Only"), N_("Label: ")},
+ { "ref", N_("Standard"), N_("Ref")},
+ { "eqref", N_("Equation"), N_("EqRef")},
+ { "pageref", N_("Page Number"), N_("Page")},
+ { "vpageref", N_("Textual Page Number"), N_("TextPage")},
+ { "vref", N_("Standard+Textual Page"), N_("Ref+Text")},
+ { "nameref", N_("Reference to Name"), N_("NameRef")},
+ { "formatted", N_("Formatted"), N_("Format")},
+ { "labelonly", N_("Label Only"), N_("Label")},
{ "", "", "" }
};