The way it works is:
* the inset defines forcePlainLayout() correctly
* Text::getStatus acts on it.
Note that, in Text::getStatus, testing for cur.inset().forcePlainLayout() does not make much sense, since one should pass the cursor idx as parameter.
There are many other lfuns that do not have to be handled directly by insets. InsetScript in particular has tests for way too many lfuns.
docstring layout = cmd.argument();
if (layout.empty())
layout = tclass.defaultLayoutName();
docstring layout = cmd.argument();
if (layout.empty())
layout = tclass.defaultLayoutName();
- enable = !cur.inset().forcePlainLayout() && tclass.hasLayout(layout);
+ enable = !owner_->forcePlainLayout() && tclass.hasLayout(layout);
flag.setOnOff(layout == cur.paragraph().layout().name());
break;
flag.setOnOff(layout == cur.paragraph().layout().name());
break;
FuncStatus & flag) const
{
switch (cmd.action()) {
FuncStatus & flag) const
{
switch (cmd.action()) {
case LFUN_LAYOUT_PARAGRAPH:
case LFUN_MATH_DISPLAY:
case LFUN_BOX_INSERT:
case LFUN_LAYOUT_PARAGRAPH:
case LFUN_MATH_DISPLAY:
case LFUN_BOX_INSERT:
///
void read(Lexer & lex);
///
///
void read(Lexer & lex);
///
+ bool forcePlainLayout(idx_type = 0) const { return true; }
+ ///
bool neverIndent() const { return true; }
///
int plaintext(odocstringstream & ods, OutputParams const & op,
bool neverIndent() const { return true; }
///
int plaintext(odocstringstream & ods, OutputParams const & op,
{
bool enabled = true;
switch (cmd.action()) {
{
bool enabled = true;
switch (cmd.action()) {
- case LFUN_LAYOUT:
- enabled = !forcePlainLayout();
- break;
case LFUN_LAYOUT_PARAGRAPH:
enabled = allowParagraphCustomization();
break;
case LFUN_LAYOUT_PARAGRAPH:
enabled = allowParagraphCustomization();
break;