]> git.lyx.org Git - features.git/commitdiff
* Paragraph.cpp (simpleTeXOnePar): fix bug with size-changing
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 12 Jul 2007 13:25:44 +0000 (13:25 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 12 Jul 2007 13:25:44 +0000 (13:25 +0000)
macro followed by a space (bug 3382)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19057 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp

index 9fc822753c68f4bc66c985bd0f352f800732f8c5..c11e934e976e8a48a53e49826dfb9964ca0f0700 100644 (file)
@@ -67,6 +67,7 @@ using std::ostream;
 namespace lyx {
 
 using support::contains;
+using support::suffixIs;
 using support::rsplit;
 
 
@@ -2076,11 +2077,20 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                     font.language() != running_font.language()) &&
                        i != body_pos - 1)
                {
-                       column += font.latexWriteStartChanges(os, bparams,
+                       odocstringstream ods;
+                       column += font.latexWriteStartChanges(ods, bparams,
                                                              runparams, basefont,
                                                              last_font);
                        running_font = font;
                        open_font = true;
+                       docstring fontchange = ods.str();
+                       // check if the fontchange ends with a trailing blank
+                       // (like "\small " (see bug 3382)
+                       if (suffixIs(fontchange, ' ') && c == ' ')
+                               os << fontchange.substr(0, fontchange.size() - 1) 
+                                  << from_ascii("{}");
+                       else
+                               os << fontchange;
                }
 
                if (c == ' ') {