+ case LFUN_INSET_MODIFY: {
+ string const first_arg = cmd.getArg(0);
+ if (first_arg == "changetype") {
+ string const type = cmd.getArg(1);
+ status.setOnOff(type == type_);
+ bool varia = type != "LongTableNoNumber";
+ // check if the immediate parent inset allows caption variation
+ if (cur.depth() > 1) {
+ if (&cur[cur.depth() - 2].inset())
+ varia = cur[cur.depth() - 2].inset().allowsCaptionVariation(type);
+ }
+ status.setEnabled(varia
+ && buffer().params().documentClass().hasInsetLayout(
+ from_ascii("Caption:" + type)));
+ return true;
+ }
+ return InsetText::getStatus(cur, cmd, status);
+ }
+