Use local babel language switch in fixed width cells in order to prevent unwanted whitespace

Fixes: #9455
This commit is contained in:
Juergen Spitzmueller 2015-04-04 11:59:01 +02:00
parent 032da815fa
commit 8c1a484cd2
5 changed files with 18 additions and 4 deletions

View File

@ -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; }

View File

@ -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
{

View File

@ -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).

View File

@ -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);

View File

@ -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 = "}";