+
+bool InsetRef::getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const
+{
+ if (cmd.action() != LFUN_INSET_MODIFY)
+ return InsetCommand::getStatus(cur, cmd, status);
+ if (cmd.getArg(0) != "ref")
+ return InsetCommand::getStatus(cur, cmd, status);
+
+ string const arg = cmd.getArg(1);
+ string pstring;
+ if (arg == "changetarget")
+ return true;
+ if (arg == "toggle-plural")
+ pstring = "plural";
+ else if (arg == "toggle-caps")
+ pstring = "caps";
+ if (!pstring.empty()) {
+ status.setEnabled(buffer().params().use_refstyle &&
+ params().getCmdName() == "formatted");
+ bool const isSet = (getParam(pstring) == "true");
+ status.setOnOff(isSet);
+ return true;
+ }
+ if (arg == "toggle-noprefix") {
+ status.setEnabled(params().getCmdName() == "labelonly");
+ bool const isSet = (getParam("noprefix") == "true");
+ status.setOnOff(isSet);
+ return true;
+ }
+ if (arg == "toggle-nolink") {
+ status.setEnabled(params().getCmdName() != "formatted" && params().getCmdName() != "labelonly");
+ bool const isSet = (getParam("nolink") == "true");
+ status.setOnOff(isSet);
+ return true;
+ }
+ // otherwise not for us
+ return InsetCommand::getStatus(cur, cmd, status);