* Paragraph.cpp (simpleTeXOnePar): fix bug with size-changing

macro followed by a space (bug 3382)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19057 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2007-07-12 13:25:44 +00:00
parent a7039727c3
commit b995f7715c

View 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 == ' ') {