]> git.lyx.org Git - features.git/commitdiff
Use local babel language switch in fixed width cells in order to prevent unwanted...
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 4 Apr 2015 09:59:01 +0000 (11:59 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 4 Apr 2015 09:59:01 +0000 (11:59 +0200)
Fixes: #9455
src/insets/Inset.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetText.h
src/output_latex.cpp

index 5fcc892dba96cd2a8417f806434e4ad5f9afc708..c582ea168f8ab512657eef897db7a897722e6c71 100644 (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; }
index 1bf349de5222bb00c08a22a43c086ea1b1203d5f..24bab873acf68e738ec0176213e9f42dbcfe5789 100644 (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
 {
index ce8ec416e8667ecee6b89c59611fb06e27c5e12a..ce55c17708fb07575eafd11761e58eb270f0f20e 100644 (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).
index 52e4702f5523dcd44c060b62ffdb009fea92656f..64b62357ff26f3d6ec27888912d7b4b9b13c549f 100644 (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);
index 3595a089fa60e03224e83c7a749ae4046ca9dab2..783be726084195a10b6ec8c4f3d9f36b59865b6b 100644 (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 = "}";