return;
}
- if (par.ownerCode() == ERT_CODE || par.ownerCode() == LISTINGS_CODE) {
+ if (par.inInset().forceLTR()) {
start_ = -1;
return;
}
break;
case LFUN_DIALOG_SHOW_NEW_INSET:
+ // FIXME: this is wrong, but I do not understand the
+ // intent (JMarc)
if (cur.inset().lyxCode() == CAPTION_CODE)
return cur.inset().getStatus(cur, cmd, flag);
- flag.setEnabled(cur.inset().lyxCode() != ERT_CODE &&
- cur.inset().lyxCode() != LISTINGS_CODE);
+ // FIXME we should consider passthru paragraphs too.
+ flag.setEnabled(!cur.inset().getLayout().isPassThru());
break;
default:
bool close = false;
odocstream::pos_type const len = os.tellp();
- if (inset->forceLTR()
+ if (inset->forceLTR()
&& running_font.isRightToLeft()
- // ERT is an exception, it should be output with no decorations at all
- && inset->lyxCode() != ERT_CODE) {
+ // ERT is an exception, it should be output with no
+ // decorations at all
+ && inset->lyxCode() != ERT_CODE) {
if (running_font.language()->lang() == "farsi")
os << "\\beginL{}";
else
for (pos_type i = 0; i < size(); ++i) {
if (Inset const * inset = getInset(i)) {
InsetCode lyx_code = inset->lyxCode();
+ // FIXME testing like that is wrong. What is
+ // the intent?
if (lyx_code != TOC_CODE &&
lyx_code != INCLUDE_CODE &&
lyx_code != GRAPHICS_CODE &&
{
return lyxrc.rtl_support
&& getParLanguage(bparams)->rightToLeft()
- && ownerCode() != ERT_CODE
- && ownerCode() != LISTINGS_CODE;
+ && !inInset().getLayout().forceLTR();
}
}
case LFUN_LANGUAGE:
- // FIXME: use isPassThru() here?
- enable = !cur.inset().forceLTR();
+ enable = !cur.inset().getLayout().isPassThru();
case LFUN_BREAK_PARAGRAPH:
enable = cur.inset().getLayout().isMultiPar();
if (!view())
enable = false;
else {
- InsetCode ic = view()->cursor().inset().lyxCode();
- enable = ic != ERT_CODE && ic != LISTINGS_CODE;
+ // FIXME we should consider passthru
+ // paragraphs too.
+ Inset const & in = view()->cursor().inset();
+ enable = !in.getLayout().isPassThru();
}
}
else if (name == "symbols") {
if (!view() || view()->cursor().inMathed())
enable = false;
else {
- InsetCode ic = view()->cursor().inset().lyxCode();
- enable = ic != ERT_CODE && ic != LISTINGS_CODE;
+ // FIXME we should consider passthru
+ // paragraphs too.
+ Inset const & in = view()->cursor().inset();
+ enable = !in.getLayout().isPassThru();
}
}
else if (name == "latexlog")