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-05 10:40:39 +02:00
parent cecd327755
commit 9f3f99dfef
6 changed files with 20 additions and 3 deletions

View File

@ -400,6 +400,9 @@ public:
{ return true; } { return true; }
/// Is the width forced to some value? /// Is the width forced to some value?
virtual bool hasFixedWidth() const { return false; } 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? /// Is the content of this inset part of the output document?
virtual bool producesOutput() const { return true; } virtual bool producesOutput() const { return true; }

View File

@ -3396,6 +3396,12 @@ bool InsetTableCell::allowParagraphCustomization(idx_type) const
} }
bool InsetTableCell::forceLocalFontSwitch() const
{
return isFixedWidth;
}
bool InsetTableCell::getStatus(Cursor & cur, FuncRequest const & cmd, bool InsetTableCell::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const FuncStatus & status) const
{ {

View File

@ -115,6 +115,8 @@ private:
virtual bool forcePlainLayout(idx_type = 0) const; virtual bool forcePlainLayout(idx_type = 0) const;
/// ///
virtual bool allowParagraphCustomization(idx_type = 0) const; virtual bool allowParagraphCustomization(idx_type = 0) const;
///
virtual bool forceLocalFontSwitch() const;
/// Is the width forced to some value? /// Is the width forced to some value?
bool hasFixedWidth() const { return isFixedWidth; } bool hasFixedWidth() const { return isFixedWidth; }
}; };

View File

@ -157,11 +157,14 @@ public:
virtual bool allowMultiPar() const { return getLayout().isMultiPar(); } virtual bool allowMultiPar() const { return getLayout().isMultiPar(); }
/// ///
/// should paragraphs be forced to use the empty layout? /// 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(); } { return getLayout().forcePlainLayout(); }
/// should the user be allowed to customize alignment, etc.? /// 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(); } { 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 /// Update the counters of this inset and of its contents
virtual void updateBuffer(ParIterator const &, UpdateType); virtual void updateBuffer(ParIterator const &, UpdateType);

View File

@ -686,7 +686,7 @@ void TeXOnePar(Buffer const & buf,
// In some insets (such as Arguments), we cannot use \selectlanguage // In some insets (such as Arguments), we cannot use \selectlanguage
bool const localswitch = !use_polyglossia bool const localswitch = !use_polyglossia
&& text.inset().getLayout().forcelocalfontswitch(); && text.inset().forceLocalFontSwitch();
if (localswitch) { if (localswitch) {
lang_begin_command = lyxrc.language_command_local; lang_begin_command = lyxrc.language_command_local;
lang_end_command = "}"; lang_end_command = "}";

View File

@ -98,6 +98,9 @@ What's new
- Fix loading of bicaption package (bug 9449). - Fix loading of bicaption package (bug 9449).
- Use local babel language switch in fixed width cells in order to prevent
unwanted whitespace (bug 9455).
* LYX2LYX * LYX2LYX