mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
Handle paragraph direction switch in captions (with polyglossia/bidi)
This commit is contained in:
parent
70bdbd3a57
commit
1a1adbc821
@ -423,6 +423,10 @@ public:
|
||||
/// 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; }
|
||||
|
@ -76,6 +76,8 @@ public:
|
||||
bool allowsCaptionVariation(std::string const &) const;
|
||||
///
|
||||
LyXAlignment contentAlignment() const;
|
||||
///
|
||||
bool forceParDirectionSwitch() const { return true; }
|
||||
private:
|
||||
///
|
||||
void setCaptionType(std::string const & type);
|
||||
|
@ -913,10 +913,12 @@ void TeXOnePar(Buffer const & buf,
|
||||
&& 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;
|
||||
|
Loading…
Reference in New Issue
Block a user