/// if this inset has paragraphs should they be forced to use a
/// local font language switch?
virtual bool forceLocalFontSwitch() const { return false; }
+ /// if this inset has paragraphs should they be forced to use a
+ /// font language switch that switches paragraph directions
+ /// (relevant with polyglossia only)?
+ virtual bool forceParDirectionSwitch() const { return false; }
/// Does the inset force a specific encoding?
virtual Encoding const * forcedEncoding(Encoding const *, Encoding const *) const
{ return 0; }
bool allowsCaptionVariation(std::string const &) const;
///
LyXAlignment contentAlignment() const;
+ ///
+ bool forceParDirectionSwitch() const { return true; }
private:
///
void setCaptionType(std::string const & type);
&& runparams.local_font != nullptr
&& outer_language->rightToLeft()
&& !par_language->rightToLeft();
- bool const localswitch = runparams_in.for_search
+ bool const localswitch =
+ (runparams_in.for_search
|| text.inset().forceLocalFontSwitch()
|| (using_begin_end && text.inset().forcePlainLayout())
- || in_polyglossia_rtl_env;
+ || in_polyglossia_rtl_env)
+ && !text.inset().forceParDirectionSwitch();
if (localswitch) {
lang_begin_command = use_polyglossia ?
"\\text$$lang$$opts{" : lyxrc.language_command_local;