]> git.lyx.org Git - features.git/commitdiff
Font.cpp: fix bug #8424
authorUwe Stöhr <uwestoehr@lyx.org>
Mon, 19 Nov 2012 00:13:37 +0000 (01:13 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Mon, 19 Nov 2012 00:13:37 +0000 (01:13 +0100)
We must group the content which should be changed in size wit a pair of braces because the LaTeX size commands are otherwise switches. We already do so for many case, but not for the case that a size command is inside another command. This patch adds now always a brace pair around the selected text which is the safest method.

src/Font.cpp

index 08501759c710797b4740e1d8e2c05b47482c4a79..6e7ab347337476df893c3ea763d7071891cad364 100644 (file)
@@ -332,7 +332,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                }
        }
 
-       // When the current language is Hebrew, Arabic, or Farsi
+       // If the current language is Hebrew, Arabic, or Farsi
        // the numbers are written Left-to-Right. ArabTeX package
        // reorders the number automatically but the packages used
        // for Hebrew and Farsi (Arabi) do not.
@@ -428,7 +428,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                }
                os << '\\'
                   << LaTeXSizeNames[f.size()]
-                  << ' ';
+                  << '{';
                count += strlen(LaTeXSizeNames[f.size()]) + 2;
        }
        return count;
@@ -513,6 +513,8 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
                        os << '}';
                        ++count;
                }
+               os << '}';
+               ++count;
        }
 
        // When the current language is Hebrew, Arabic, or Farsi