From: Juergen Spitzmueller Date: Sat, 4 Apr 2015 09:59:01 +0000 (+0200) Subject: Use local babel language switch in fixed width cells in order to prevent unwanted... X-Git-Tag: 2.2.0alpha1~1057 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8c1a484cd26e1ac7a94c2b098949769c61ef9766;p=features.git Use local babel language switch in fixed width cells in order to prevent unwanted whitespace Fixes: #9455 --- diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 5fcc892dba..c582ea168f 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -398,6 +398,9 @@ public: { return true; } /// Is the width forced to some value? virtual bool hasFixedWidth() const { return false; } + /// if this inset has paragraphs should they be forced to use a + /// local font language switch? + virtual bool forceLocalFontSwitch() const { return false; } /// Is the content of this inset part of the output document? virtual bool producesOutput() const { return true; } diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1bf349de52..24bab873ac 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3390,6 +3390,12 @@ bool InsetTableCell::allowParagraphCustomization(idx_type) const } +bool InsetTableCell::forceLocalFontSwitch() const +{ + return isFixedWidth; +} + + bool InsetTableCell::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const { diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index ce8ec416e8..ce55c17708 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -115,9 +115,11 @@ private: virtual bool forcePlainLayout(idx_type = 0) const; /// virtual bool allowParagraphCustomization(idx_type = 0) const; + /// + virtual bool forceLocalFontSwitch() const; /// Is the width forced to some value? bool hasFixedWidth() const { return isFixedWidth; } - /// Can the cell contain several paragraphs? + /// Can the cell contain several paragraphs? /** FIXME this is wrong for multirows, that are limited to one * paragraph. However, we cannot test for this (see the big * comment above). diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index 52e4702f55..64b62357ff 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -153,11 +153,14 @@ public: virtual bool allowMultiPar() const { return getLayout().isMultiPar(); } /// /// should paragraphs be forced to use the empty layout? - virtual bool forcePlainLayout(idx_type = 0) const + virtual bool forcePlainLayout(idx_type = 0) const { return getLayout().forcePlainLayout(); } /// should the user be allowed to customize alignment, etc.? - virtual bool allowParagraphCustomization(idx_type = 0) const + virtual bool allowParagraphCustomization(idx_type = 0) const { return getLayout().allowParagraphCustomization(); } + /// should paragraphs be forced to use a local font language switch? + virtual bool forceLocalFontSwitch() const + { return getLayout().forcelocalfontswitch(); } /// Update the counters of this inset and of its contents virtual void updateBuffer(ParIterator const &, UpdateType); diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 3595a089fa..783be72608 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -672,7 +672,7 @@ void TeXOnePar(Buffer const & buf, // In some insets (such as Arguments), we cannot use \selectlanguage bool const localswitch = !use_polyglossia - && text.inset().getLayout().forcelocalfontswitch(); + && text.inset().forceLocalFontSwitch(); if (localswitch) { lang_begin_command = lyxrc.language_command_local; lang_end_command = "}";